`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    22:27:03 03/23/2014 
// Design Name: 
// Module Name:    sprite_display 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module sprite_display(red, green, blue, hcounter, vcounter, blank, pclk, inccredit, deccredit, Player1, Alienpos, Alienstat, Player1_Bullet, Bonus, Score1, Shields, Alien_Bullet1);

	input blank, pclk, inccredit, deccredit;
	input [10:0] hcounter, vcounter;
	
	input [12:0] Player1;
	input [21:0] Alienpos;
	//input [54:0] Alienstat;
	input [21:0] Alienstat;
	input [22:0] Player1_Bullet;
	input [11:0] Bonus;
	input [10:0] Score1;
	input [7:0] Shields;
	input [22:0] Alien_Bullet1;
	//input [22:0] Alien_Bullet2;
	//input [22:0] Alien_Bullet3;
	
	
	/*
	reg [12:0] Player1 = 13'b11_00100000000;
	reg [21:0] Alienpos = 22'b00001111100_00001100100;
	reg [54:0] Alienstat = 55'b10000000001_11111111100_00111111111_11110001111_10101010101;
	reg [22:0] Player1_Bullet = 23'b1_00000001000_00000001000;
	reg [11:0] Bonus = 12'b1_00011111111;
	reg [10:0] Score1 = 11'b11111111111;
	reg [7:0] Shields = 8'b00_01_10_01;
	*/
	
	output reg [2:0] red, green;
	output reg [1:0] blue;
	
	//parameters
	parameter line1_v = 10;
	parameter line2_v = 35;
	parameter line3_v = 450;
	
	//sprite arrays
	reg [15:0] sprite_D [0:15];
	reg [15:0] sprite_T [0:15];
	reg [15:0] sprite_H [0:15];
	reg [15:0] sprite_I [0:15];
	reg [15:0] sprite_hyphen [0:15];
	reg [15:0] sprite_S [0:15];
	reg [15:0] sprite_C [0:15];
	reg [15:0] sprite_O [0:15];
	reg [15:0] sprite_R [0:15];
	reg [15:0] sprite_E [0:15];
	reg [15:0] sprite_left_arrow [0:15];
	reg [15:0] sprite_right_arrow [0:15];
	reg [15:0] sprite_0 [0:15];
	reg [15:0] sprite_1 [0:15];
	reg [15:0] sprite_2 [0:15];
	reg [15:0] sprite_3 [0:15];
	reg [15:0] sprite_4 [0:15];
	reg [15:0] sprite_5 [0:15];
	reg [15:0] sprite_6 [0:15];
	reg [15:0] sprite_7 [0:15];
	reg [15:0] sprite_8 [0:15];
	reg [15:0] sprite_9 [0:15];
	
	reg [15:0] digit_0 [0:15];
	reg [15:0] digit_1 [0:15];
	reg [15:0] digit_2 [0:15];
	reg [15:0] digit_3 [0:15];
	reg [15:0] digit_4 [0:15];
	reg [15:0] digit_5 [0:15];
	reg [15:0] digit_6 [0:15];
	reg [15:0] digit_7 [0:15];
	reg [15:0] digit_8 [0:15];
	reg [15:0] digit_9 [0:15];

	reg [17:0] sprite_enemy1 [0:17];
	reg [17:0] sprite_enemy1_v2 [0:17];
	reg [17:0] sprite_explosion_enemy1 [0:17];
	reg [23:0] sprite_enemy2 [0:17];
	reg [23:0] sprite_enemy2_v2 [0:17];
	reg [23:0] sprite_explosion_enemy2 [0:17];
	reg [25:0] sprite_enemy3 [0:17];
	reg [25:0] sprite_enemy3_v2 [0:17];
	reg [25:0] sprite_explosion_enemy3 [0:17];
	reg [33:0] sprite_bonus [0:15];
	reg [45:0] sprite_block_v1 [0:33];
	reg [45:0] sprite_block_v2 [0:33];
	reg [45:0] sprite_block_v3 [0:33];
	reg [45:0] sprite_block_v4 [0:33];
	reg [45:0] sprite_block_v5 [0:33];
	reg [27:0] sprite_player [0:17];
	reg [27:0] sprite_explosion_player [0:17];
	
	reg [3:0] sprite_bullet_player [0:9];
	reg [7:0] sprite_bullet_enemy_v1 [0:12];
	reg [7:0] sprite_bullet_enemy_v2 [0:12];
	reg [7:0] sprite_bullet_enemy_v3 [0:12];
	reg [7:0] sprite_bullet_enemy_v4 [0:12];
	reg [7:0] sprite_bullet_enemy_v5 [0:12];
	reg [7:0] sprite_bullet_enemy_v6 [0:12];
	
	//sprite rows
	reg [15:0] letter1_row, letter2_row, letter3_row, letter4_row, letter5_row, letter6_row, letter7_row, letter8_row, letter9_row, letter10_row;
	reg [15:0] letter11_row, letter12_row, letter13_row, letter14_row, letter15_row, letter16_row;
	reg [15:0] letter17_row, letter18_row, letter19_row, letter20_row, letter21_row, letter22_row, letter23_row, letter24_row;
	reg [15:0] letter25_row, letter26_row, letter27_row, letter28_row, letter29_row, letter30_row;
	reg [15:0] digit0_row, digit1_row, digit2_row, digit3_row, digit4_row, digit5_row, digit6_row, digit7_row, digit8_row, digit9_row, life_digit_row; 
	reg [17:0] enemy11_row, enemy12_row, enemy13_row, enemy14_row, enemy15_row, enemy16_row, enemy17_row, enemy18_row, enemy19_row, enemy1a_row, enemy1b_row;
	reg [23:0] enemy211_row, enemy212_row, enemy213_row, enemy214_row, enemy215_row, enemy216_row, enemy217_row, enemy218_row, enemy219_row, enemy21a_row, enemy21b_row;
	reg [23:0] enemy221_row, enemy222_row, enemy223_row, enemy224_row, enemy225_row, enemy226_row, enemy227_row, enemy228_row, enemy229_row, enemy22a_row, enemy22b_row;
	reg [25:0] enemy311_row, enemy312_row, enemy313_row, enemy314_row, enemy315_row, enemy316_row, enemy317_row, enemy318_row, enemy319_row, enemy31a_row, enemy31b_row;
	reg [25:0] enemy321_row, enemy322_row, enemy323_row, enemy324_row, enemy325_row, enemy326_row, enemy327_row, enemy328_row, enemy329_row, enemy32a_row, enemy32b_row;
	reg [33:0] bonus_row;
	reg [27:0] player_row, life1_row, life2_row;
	reg [45:0] block1_row, block2_row, block3_row, block4_row;
	reg [3:0] bullet0_row;
	reg [7:0] bullet1_row, bullet2_row, bullet3_row;
	
	//image on signal
	reg letter1_on, letter2_on, letter3_on, letter4_on, letter5_on, letter6_on, letter7_on, letter8_on, letter9_on, letter10_on, letter11_on;
	reg letter12_on, letter13_on, letter14_on, letter15_on, letter16_on, letter17_on, letter18_on, letter19_on, letter20_on, letter21_on;
	reg letter22_on, letter23_on, letter24_on, letter25_on,  letter26_on,  letter27_on,  letter28_on,  letter29_on, letter30_on;
	reg digit0_on, digit1_on, digit2_on, digit3_on, digit4_on, digit5_on, digit6_on, digit7_on, digit8_on, digit9_on, line_on;
	reg enemy11_on, enemy12_on, enemy13_on, enemy14_on, enemy15_on, enemy16_on, enemy17_on, enemy18_on, enemy19_on, enemy1a_on, enemy1b_on;
	reg enemy211_on, enemy212_on, enemy213_on, enemy214_on, enemy215_on, enemy216_on, enemy217_on, enemy218_on, enemy219_on, enemy21a_on, enemy21b_on;
	reg enemy221_on, enemy222_on, enemy223_on, enemy224_on, enemy225_on, enemy226_on, enemy227_on, enemy228_on, enemy229_on, enemy22a_on, enemy22b_on;
	reg enemy311_on, enemy312_on, enemy313_on, enemy314_on, enemy315_on, enemy316_on, enemy317_on, enemy318_on, enemy319_on, enemy31a_on, enemy31b_on;
	reg enemy321_on, enemy322_on, enemy323_on, enemy324_on, enemy325_on, enemy326_on, enemy327_on, enemy328_on, enemy329_on, enemy32a_on, enemy32b_on;
	reg player_on, life1_on, life2_on, life_digit_on, bonus_on;
	reg block1_on, block2_on, block3_on, block4_on;	
	reg bullet0_on, bullet1_on, bullet2_on, bullet3_on; 
	//clk divider reg
	reg [24:0] div = 0;
	//reg [23:0] div2 = 0;
	
	//reg [11:0] bonus_h = 210;
	//reg [11:0] step_bonus;
	
	reg [6:0] credit = 0;
	reg [3:0] credit_b1 = 0, credit_b0 = 0;
	reg [3:0] score1_b3 = 0, score1_b2 = 0, score1_b1 = 0, score1_b0 = 0;
	
	integer i = 0, j = 0;
	
	always @ (posedge (pclk)) begin
		sprite_D[ 0] <= 16'b0000000000000000; 
		sprite_D[ 1] <= 16'b0001111111100000;
		sprite_D[ 2] <= 16'b0001111111100000;
		sprite_D[ 3] <= 16'b0001100000011000;
		sprite_D[ 4] <= 16'b0001100000011000;
		sprite_D[ 5] <= 16'b0001100000011000;
		sprite_D[ 6] <= 16'b0001100000011000;
		sprite_D[ 7] <= 16'b0001100000011000;
		sprite_D[ 8] <= 16'b0001100000011000;
		sprite_D[ 9] <= 16'b0001100000011000;
		sprite_D[10] <= 16'b0001100000011000;
		sprite_D[11] <= 16'b0001100000011000;
		sprite_D[12] <= 16'b0001100000011000;
		sprite_D[13] <= 16'b0001111111100000;
		sprite_D[14] <= 16'b0001111111100000;
		sprite_D[15] <= 16'b0000000000000000;
		
		sprite_T[ 0] <= 16'b0000000000000000;
		sprite_T[ 1] <= 16'b0001111111111000;
		sprite_T[ 2] <= 16'b0001111111111000;
		sprite_T[ 3] <= 16'b0000000110000000;
		sprite_T[ 4] <= 16'b0000000110000000;
		sprite_T[ 5] <= 16'b0000000110000000;
		sprite_T[ 6] <= 16'b0000000110000000;
		sprite_T[ 7] <= 16'b0000000110000000;
		sprite_T[ 8] <= 16'b0000000110000000;
		sprite_T[ 9] <= 16'b0000000110000000;
		sprite_T[10] <= 16'b0000000110000000;
		sprite_T[11] <= 16'b0000000110000000;
		sprite_T[12] <= 16'b0000000110000000;
		sprite_T[13] <= 16'b0000000110000000;
		sprite_T[14] <= 16'b0000000110000000;
		sprite_T[15] <= 16'b0000000000000000;

		sprite_H[ 0] <= 16'b0000000000000000; 
		sprite_H[ 1] <= 16'b0001100000011000;
		sprite_H[ 2] <= 16'b0001100000011000; 
		sprite_H[ 3] <= 16'b0001100000011000; 
		sprite_H[ 4] <= 16'b0001100000011000; 
		sprite_H[ 5] <= 16'b0001100000011000; 
		sprite_H[ 6] <= 16'b0001100000011000; 
		sprite_H[ 7] <= 16'b0001111111111000; 
		sprite_H[ 8] <= 16'b0001111111111000; 
		sprite_H[ 9] <= 16'b0001100000011000; 
		sprite_H[10] <= 16'b0001100000011000; 
		sprite_H[11] <= 16'b0001100000011000; 
		sprite_H[12] <= 16'b0001100000011000;
		sprite_H[13] <= 16'b0001100000011000;
		sprite_H[14] <= 16'b0001100000011000;
		sprite_H[15] <= 16'b0000000000000000;

		sprite_I[ 0] <= 16'b0000000000000000; 
		sprite_I[ 1] <= 16'b0000011111100000;
		sprite_I[ 2] <= 16'b0000011111100000; 
		sprite_I[ 3] <= 16'b0000000110000000; 
		sprite_I[ 4] <= 16'b0000000110000000; 
		sprite_I[ 5] <= 16'b0000000110000000; 
		sprite_I[ 6] <= 16'b0000000110000000; 
		sprite_I[ 7] <= 16'b0000000110000000; 
		sprite_I[ 8] <= 16'b0000000110000000; 
		sprite_I[ 9] <= 16'b0000000110000000; 
		sprite_I[10] <= 16'b0000000110000000; 
		sprite_I[11] <= 16'b0000000110000000; 
		sprite_I[12] <= 16'b0000000110000000;
		sprite_I[13] <= 16'b0000011111100000;
		sprite_I[14] <= 16'b0000011111100000;
		sprite_I[15] <= 16'b0000000000000000;

		sprite_hyphen [ 0] <= 16'b0000000000000000;
		sprite_hyphen [ 1] <= 16'b0000000000000000;
		sprite_hyphen [ 2] <= 16'b0000000000000000;
		sprite_hyphen [ 3] <= 16'b0000000000000000;
		sprite_hyphen [ 4] <= 16'b0000000000000000;
		sprite_hyphen [ 5] <= 16'b0000000000000000;
		sprite_hyphen [ 6] <= 16'b0000000000000000;
		sprite_hyphen [ 7] <= 16'b0001111111111000;
		sprite_hyphen [ 8] <= 16'b0001111111111000;
		sprite_hyphen [ 9] <= 16'b0000000000000000;
		sprite_hyphen [10] <= 16'b0000000000000000;
		sprite_hyphen [11] <= 16'b0000000000000000;
		sprite_hyphen [12] <= 16'b0000000000000000;
		sprite_hyphen [13] <= 16'b0000000000000000;
		sprite_hyphen [14] <= 16'b0000000000000000;
		sprite_hyphen [15] <= 16'b0000000000000000;
		
		sprite_S[ 0] <= 16'b0000000000000000; 
		sprite_S[ 1] <= 16'b0000011111100000;
		sprite_S[ 2] <= 16'b0000011111100000; 
		sprite_S[ 3] <= 16'b0001100000011000; 
		sprite_S[ 4] <= 16'b0001100000011000; 
		sprite_S[ 5] <= 16'b0001100000000000; 
		sprite_S[ 6] <= 16'b0001100000000000; 
		sprite_S[ 7] <= 16'b0000011111100000; 
		sprite_S[ 8] <= 16'b0000011111100000; 
		sprite_S[ 9] <= 16'b0000000000011000; 
		sprite_S[10] <= 16'b0000000000011000; 
		sprite_S[11] <= 16'b0001100000011000; 
		sprite_S[12] <= 16'b0001100000011000;
		sprite_S[13] <= 16'b0000011111100000;
		sprite_S[14] <= 16'b0000011111100000;
		sprite_S[15] <= 16'b0000000000000000;
		
		sprite_C[ 0] <= 16'b0000000000000000; 
		sprite_C[ 1] <= 16'b0000011111100000; 
		sprite_C[ 2] <= 16'b0000011111100000; 
		sprite_C[ 3] <= 16'b0001100000011000; 
		sprite_C[ 4] <= 16'b0001100000011000; 
		sprite_C[ 5] <= 16'b0001100000000000; 
		sprite_C[ 6] <= 16'b0001100000000000; 
		sprite_C[ 7] <= 16'b0001100000000000; 
		sprite_C[ 8] <= 16'b0001100000000000; 
		sprite_C[ 9] <= 16'b0001100000000000; 
		sprite_C[10] <= 16'b0001100000000000; 
		sprite_C[11] <= 16'b0001100000011000; 
		sprite_C[12] <= 16'b0001100000011000; 
		sprite_C[13] <= 16'b0000011111100000; 
		sprite_C[14] <= 16'b0000011111100000; 
		sprite_C[15] <= 16'b0000000000000000; 
			
		sprite_O[ 0] <= 16'b0000000000000000; 
		sprite_O[ 1] <= 16'b0000011111100000; 
		sprite_O[ 2] <= 16'b0000011111100000; 
		sprite_O[ 3] <= 16'b0001100000011000; 
		sprite_O[ 4] <= 16'b0001100000011000; 
		sprite_O[ 5] <= 16'b0001100000011000; 
		sprite_O[ 6] <= 16'b0001100000011000; 
		sprite_O[ 7] <= 16'b0001100000011000; 
		sprite_O[ 8] <= 16'b0001100000011000;
		sprite_O[ 9] <= 16'b0001100000011000; 
		sprite_O[10] <= 16'b0001100000011000; 
		sprite_O[11] <= 16'b0001100000011000; 
		sprite_O[12] <= 16'b0001100000011000; 
		sprite_O[13] <= 16'b0000011111100000;
		sprite_O[14] <= 16'b0000011111100000;
		sprite_O[15] <= 16'b0000000000000000;

		sprite_R[ 0] <= 16'b0000000000000000; 
		sprite_R[ 1] <= 16'b0001111111100000; 
		sprite_R[ 2] <= 16'b0001111111100000; 
		sprite_R[ 3] <= 16'b0001100000011000; 
		sprite_R[ 4] <= 16'b0001100000011000; 
		sprite_R[ 5] <= 16'b0001100000011000; 
		sprite_R[ 6] <= 16'b0001100000011000; 
		sprite_R[ 7] <= 16'b0001111111100000; 
		sprite_R[ 8] <= 16'b0001111111100000; 
		sprite_R[ 9] <= 16'b0001100110000000; 
		sprite_R[10] <= 16'b0001100110000000; 
		sprite_R[11] <= 16'b0001100001100000; 
		sprite_R[12] <= 16'b0001100001100000; 
		sprite_R[13] <= 16'b0001100000011000; 
		sprite_R[14] <= 16'b0001100000011000; 
		sprite_R[15] <= 16'b0000000000000000;


		sprite_E[ 0] <= 16'b0000000000000000; 
		sprite_E[ 1] <= 16'b0001111111111000; 
		sprite_E[ 2] <= 16'b0001111111111000; 
		sprite_E[ 3] <= 16'b0001100000000000; 
		sprite_E[ 4] <= 16'b0001100000000000; 
		sprite_E[ 5] <= 16'b0001100000000000; 
		sprite_E[ 6] <= 16'b0001100000000000; 
		sprite_E[ 7] <= 16'b0001111111100000; 
		sprite_E[ 8] <= 16'b0001111111100000; 
		sprite_E[ 9] <= 16'b0001100000000000; 
		sprite_E[10] <= 16'b0001100000000000; 
		sprite_E[11] <= 16'b0001100000000000; 
		sprite_E[12] <= 16'b0001100000000000; 
		sprite_E[13] <= 16'b0001111111111000; 
		sprite_E[14] <= 16'b0001111111111000; 
		sprite_E[15] <= 16'b0000000000000000; 

		sprite_left_arrow[ 0] <= 16'b0000000000000000;
		sprite_left_arrow[ 1] <= 16'b0000000000110000;
		sprite_left_arrow[ 2] <= 16'b0000000000110000;
		sprite_left_arrow[ 3] <= 16'b0000000011000000;
		sprite_left_arrow[ 4] <= 16'b0000000011000000;
		sprite_left_arrow[ 5] <= 16'b0000001100000000;
		sprite_left_arrow[ 6] <= 16'b0000001100000000;
		sprite_left_arrow[ 7] <= 16'b0000110000000000;
		sprite_left_arrow[ 8] <= 16'b0000110000000000;
		sprite_left_arrow[ 9] <= 16'b0000001100000000;
		sprite_left_arrow[10] <= 16'b0000001100000000;
		sprite_left_arrow[11] <= 16'b0000000011000000;
		sprite_left_arrow[12] <= 16'b0000000011000000;
		sprite_left_arrow[13] <= 16'b0000000000110000;
		sprite_left_arrow[14] <= 16'b0000000000110000;
		sprite_left_arrow[15] <= 16'b0000000000000000;

		sprite_right_arrow[ 0] <= 16'b0000000000000000;
		sprite_right_arrow[ 1] <= 16'b0000110000000000;
		sprite_right_arrow[ 2] <= 16'b0000110000000000;
		sprite_right_arrow[ 3] <= 16'b0000001100000000;
		sprite_right_arrow[ 4] <= 16'b0000001100000000;
		sprite_right_arrow[ 5] <= 16'b0000000011000000;
		sprite_right_arrow[ 6] <= 16'b0000000011000000;
		sprite_right_arrow[ 7] <= 16'b0000000000110000;
		sprite_right_arrow[ 8] <= 16'b0000000000110000;
		sprite_right_arrow[ 9] <= 16'b0000000011000000;
		sprite_right_arrow[10] <= 16'b0000000011000000;
		sprite_right_arrow[11] <= 16'b0000001100000000;
		sprite_right_arrow[12] <= 16'b0000001100000000;
		sprite_right_arrow[13] <= 16'b0000110000000000;
		sprite_right_arrow[14] <= 16'b0000110000000000;
		sprite_right_arrow[15] <= 16'b0000000000000000;
		
		sprite_0[ 0] <= 16'b0000000000000000;
		sprite_0[ 1] <= 16'b0000011111100000;
		sprite_0[ 2] <= 16'b0000011111100000;
		sprite_0[ 3] <= 16'b0001100000011000;
		sprite_0[ 4] <= 16'b0001100000011000;
		sprite_0[ 5] <= 16'b0001100001111000;
		sprite_0[ 6] <= 16'b0001100001111000;
		sprite_0[ 7] <= 16'b0001100110011000;
		sprite_0[ 8] <= 16'b0001100110011000;
		sprite_0[ 9] <= 16'b0001111000011000;
		sprite_0[10] <= 16'b0001111000011000;
		sprite_0[11] <= 16'b0001100000011000;
		sprite_0[12] <= 16'b0001100000011000;
		sprite_0[13] <= 16'b0000011111100000;
		sprite_0[14] <= 16'b0000011111100000;
		sprite_0[15] <= 16'b0000000000000000;
		
		sprite_1[ 0] <= 16'b0000000000000000;
		sprite_1[ 1] <= 16'b0000000110000000;
		sprite_1[ 2] <= 16'b0000000110000000;
		sprite_1[ 3] <= 16'b0000011110000000;
		sprite_1[ 4] <= 16'b0000011110000000;
		sprite_1[ 5] <= 16'b0000000110000000;
		sprite_1[ 6] <= 16'b0000000110000000;
		sprite_1[ 7] <= 16'b0000000110000000;
		sprite_1[ 8] <= 16'b0000000110000000;
		sprite_1[ 9] <= 16'b0000000110000000;
		sprite_1[10] <= 16'b0000000110000000;
		sprite_1[11] <= 16'b0000000110000000;
		sprite_1[12] <= 16'b0000000110000000;
		sprite_1[13] <= 16'b0000011111100000;
		sprite_1[14] <= 16'b0000011111100000;
		sprite_1[15] <= 16'b0000000000000000;
		
		sprite_2[ 0] <= 16'b0000000000000000;
		sprite_2[ 1] <= 16'b0000011111100000;
		sprite_2[ 2] <= 16'b0000011111100000;
		sprite_2[ 3] <= 16'b0001100000011000;
		sprite_2[ 4] <= 16'b0001100000011000;
		sprite_2[ 5] <= 16'b0000000000011000;
		sprite_2[ 6] <= 16'b0000000000011000;
		sprite_2[ 7] <= 16'b0000000111100000;
		sprite_2[ 8] <= 16'b0000000111100000;
		sprite_2[ 9] <= 16'b0000011000000000;
		sprite_2[10] <= 16'b0000011000000000;
		sprite_2[11] <= 16'b0001100000000000;
		sprite_2[12] <= 16'b0001100000000000;
		sprite_2[13] <= 16'b0001111111111000;
		sprite_2[14] <= 16'b0001111111111000;
		sprite_2[15] <= 16'b0000000000000000;

		sprite_3[ 0] <= 16'b0000000000000000;
		sprite_3[ 1] <= 16'b0001111111111000;
		sprite_3[ 2] <= 16'b0001111111111000;
		sprite_3[ 3] <= 16'b0000000000011000;
		sprite_3[ 4] <= 16'b0000000000011000;
		sprite_3[ 5] <= 16'b0000000001100000;
		sprite_3[ 6] <= 16'b0000000001100000;
		sprite_3[ 7] <= 16'b0000000111100000;
		sprite_3[ 8] <= 16'b0000000111100000;
		sprite_3[ 9] <= 16'b0000000000011000;
		sprite_3[10] <= 16'b0000000000011000;
		sprite_3[11] <= 16'b0001100000011000;
		sprite_3[12] <= 16'b0001100000011000;
		sprite_3[13] <= 16'b0000011111100000;
		sprite_3[14] <= 16'b0000011111100000;
		sprite_3[15] <= 16'b0000000000000000;

		sprite_4[ 0] <= 16'b0000000000000000;
		sprite_4[ 1] <= 16'b0000000001100000;
		sprite_4[ 2] <= 16'b0000000001100000;
		sprite_4[ 3] <= 16'b0000000111100000;
		sprite_4[ 4] <= 16'b0000000111100000;
		sprite_4[ 5] <= 16'b0000011001100000;
		sprite_4[ 6] <= 16'b0000011001100000;
		sprite_4[ 7] <= 16'b0001100001100000;
		sprite_4[ 8] <= 16'b0001100001100000;
		sprite_4[ 9] <= 16'b0001111111111000;
		sprite_4[10] <= 16'b0001111111111000;
		sprite_4[11] <= 16'b0000000001100000;
		sprite_4[12] <= 16'b0000000001100000;
		sprite_4[13] <= 16'b0000000001100000;
		sprite_4[14] <= 16'b0000000001100000;
		sprite_4[15] <= 16'b0000000000000000;

		sprite_5[ 0] <= 16'b0000000000000000;
		sprite_5[ 1] <= 16'b0001111111111000;
		sprite_5[ 2] <= 16'b0001111111111000;
		sprite_5[ 3] <= 16'b0001100000000000;
		sprite_5[ 4] <= 16'b0001100000000000;
		sprite_5[ 5] <= 16'b0001111111100000;
		sprite_5[ 6] <= 16'b0001111111100000;
		sprite_5[ 7] <= 16'b0000000000011000;
		sprite_5[ 8] <= 16'b0000000000011000;
		sprite_5[ 9] <= 16'b0000000000011000;
		sprite_5[10] <= 16'b0000000000011000;
		sprite_5[11] <= 16'b0001100000011000;
		sprite_5[12] <= 16'b0001100000011000;
		sprite_5[13] <= 16'b0000011111100000;
		sprite_5[14] <= 16'b0000011111100000;
		sprite_5[15] <= 16'b0000000000000000;

		sprite_6[ 0] <= 16'b0000000000000000;
		sprite_6[ 1] <= 16'b0000000111111000;
		sprite_6[ 2] <= 16'b0000000111111000;
		sprite_6[ 3] <= 16'b0000011000000000;
		sprite_6[ 4] <= 16'b0000011000000000;
		sprite_6[ 5] <= 16'b0001100000000000;
		sprite_6[ 6] <= 16'b0001100000000000;
		sprite_6[ 7] <= 16'b0001111111100000;
		sprite_6[ 8] <= 16'b0001111111100000;
		sprite_6[ 9] <= 16'b0001100000011000;
		sprite_6[10] <= 16'b0001100000011000;
		sprite_6[11] <= 16'b0001100000011000;
		sprite_6[12] <= 16'b0001100000011000;
		sprite_6[13] <= 16'b0000011111100000;
		sprite_6[14] <= 16'b0000011111100000;
		sprite_6[15] <= 16'b0000000000000000;

		sprite_7[ 0] <= 16'b0000000000000000;
		sprite_7[ 1] <= 16'b0001111111111000;
		sprite_7[ 2] <= 16'b0001111111111000;
		sprite_7[ 3] <= 16'b0000000000011000;
		sprite_7[ 4] <= 16'b0000000000011000;
		sprite_7[ 5] <= 16'b0000000001100000;
		sprite_7[ 6] <= 16'b0000000001100000;
		sprite_7[ 7] <= 16'b0000000110000000;
		sprite_7[ 8] <= 16'b0000000110000000;
		sprite_7[ 9] <= 16'b0000011000000000;
		sprite_7[10] <= 16'b0000011000000000;
		sprite_7[11] <= 16'b0000011000000000;
		sprite_7[12] <= 16'b0000011000000000;
		sprite_7[13] <= 16'b0000011000000000;
		sprite_7[14] <= 16'b0000011000000000;
		sprite_7[15] <= 16'b0000000000000000;

		sprite_8[ 0] <= 16'b0000000000000000;
		sprite_8[ 1] <= 16'b0000011111100000;
		sprite_8[ 2] <= 16'b0000011111100000;
		sprite_8[ 3] <= 16'b0001100000011000;
		sprite_8[ 4] <= 16'b0001100000011000;
		sprite_8[ 5] <= 16'b0001100000011000;
		sprite_8[ 6] <= 16'b0001100000011000;
		sprite_8[ 7] <= 16'b0000011111100000;
		sprite_8[ 8] <= 16'b0000011111100000;
		sprite_8[ 9] <= 16'b0001100000011000;
		sprite_8[10] <= 16'b0001100000011000;
		sprite_8[11] <= 16'b0001100000011000;
		sprite_8[12] <= 16'b0001100000011000;
		sprite_8[13] <= 16'b0000111111000000;
		sprite_8[14] <= 16'b0000011111100000;
		sprite_8[15] <= 16'b0000000000000000;

		sprite_9[ 0] <= 16'b0000000000000000;
		sprite_9[ 1] <= 16'b0000011111100000;
		sprite_9[ 2] <= 16'b0000011111100000;
		sprite_9[ 3] <= 16'b0001100000011000;
		sprite_9[ 4] <= 16'b0001100000011000;
		sprite_9[ 5] <= 16'b0001100000011000;
		sprite_9[ 6] <= 16'b0001100000011000;
		sprite_9[ 7] <= 16'b0000011111111000;
		sprite_9[ 8] <= 16'b0000011111111000;
		sprite_9[ 9] <= 16'b0000000001111000;
		sprite_9[10] <= 16'b0000000001111000;
		sprite_9[11] <= 16'b0000000111100000;
		sprite_9[12] <= 16'b0000000111100000;
		sprite_9[13] <= 16'b0000011110000000;
		sprite_9[14] <= 16'b0000011110000000;
		sprite_9[15] <= 16'b0000000000000000;

		sprite_enemy1[ 0] <= 18'b000000000000000000;
		sprite_enemy1[ 1] <= 18'b000000011110000000;
		sprite_enemy1[ 2] <= 18'b000000011110000000;
		sprite_enemy1[ 3] <= 18'b000001111111100000;
		sprite_enemy1[ 4] <= 18'b000001111111100000;
		sprite_enemy1[ 5] <= 18'b000111111111111000;
		sprite_enemy1[ 6] <= 18'b000111111111111000;
		sprite_enemy1[ 7] <= 18'b011110011110011110;
		sprite_enemy1[ 8] <= 18'b011110011110011110;
		sprite_enemy1[ 9] <= 18'b011111111111111110;
		sprite_enemy1[10] <= 18'b011111111111111110;
		sprite_enemy1[11] <= 18'b000110011110011000;
		sprite_enemy1[12] <= 18'b000110011110011000;
		sprite_enemy1[13] <= 18'b011000000000000110;
		sprite_enemy1[14] <= 18'b011000000000000110;
		sprite_enemy1[15] <= 18'b000110000000011000;
		sprite_enemy1[16] <= 18'b000110000000011000;
		sprite_enemy1[17] <= 18'b000000000000000000;
		
		sprite_enemy1_v2[ 0] <= 18'b000000000000000000;
		sprite_enemy1_v2[ 1] <= 18'b000000011110000000;
		sprite_enemy1_v2[ 2] <= 18'b000000011110000000;
		sprite_enemy1_v2[ 3] <= 18'b000001111111100000;
		sprite_enemy1_v2[ 4] <= 18'b000001111111100000;
		sprite_enemy1_v2[ 5] <= 18'b000111111111111000;
		sprite_enemy1_v2[ 6] <= 18'b000111111111111000;
		sprite_enemy1_v2[ 7] <= 18'b011110011110011110;
		sprite_enemy1_v2[ 8] <= 18'b011110011110011110;
		sprite_enemy1_v2[ 9] <= 18'b011111111111111110;
		sprite_enemy1_v2[10] <= 18'b011111111111111110;
		sprite_enemy1_v2[11] <= 18'b000001100001100000;
		sprite_enemy1_v2[12] <= 18'b000001100001100000;
		sprite_enemy1_v2[13] <= 18'b000110011110011000;
		sprite_enemy1_v2[14] <= 18'b000110011110011000;
		sprite_enemy1_v2[15] <= 18'b011001100001100110;
		sprite_enemy1_v2[16] <= 18'b011001100001100110;
		sprite_enemy1_v2[17] <= 18'b000000000000000000;	
		
		sprite_enemy2[ 0] <= 24'b000000000000000000000000;
		sprite_enemy2[ 1] <= 24'b000001100000000001100000;
		sprite_enemy2[ 2] <= 24'b000001100000000001100000;
		sprite_enemy2[ 3] <= 24'b000000011000000110000000;
		sprite_enemy2[ 4] <= 24'b000000011000000110000000;
		sprite_enemy2[ 5] <= 24'b000001111111111111100000;
		sprite_enemy2[ 6] <= 24'b000001111111111111100000;
		sprite_enemy2[ 7] <= 24'b000111100111111001111000;
		sprite_enemy2[ 8] <= 24'b000111100111111001111000;
		sprite_enemy2[ 9] <= 24'b011111111111111111111110;
		sprite_enemy2[10] <= 24'b011111111111111111111110;
		sprite_enemy2[11] <= 24'b011001111111111111100110;
		sprite_enemy2[12] <= 24'b011001111111111111100110;
		sprite_enemy2[13] <= 24'b011001100000000001100110;
		sprite_enemy2[14] <= 24'b011001100000000001100110;
		sprite_enemy2[15] <= 24'b000000011110011110000000;
		sprite_enemy2[16] <= 24'b000000011110011110000000;
		sprite_enemy2[17] <= 24'b000000000000000000000000;

		sprite_enemy2_v2[ 0] <= 24'b000000000000000000000000;
		sprite_enemy2_v2[ 1] <= 24'b000001100000000001100000;
		sprite_enemy2_v2[ 2] <= 24'b000001100000000001100000;
		sprite_enemy2_v2[ 3] <= 24'b011000011000000110000110;
		sprite_enemy2_v2[ 4] <= 24'b011000011000000110000110;
		sprite_enemy2_v2[ 5] <= 24'b011001111111111111100110;
		sprite_enemy2_v2[ 6] <= 24'b011001111111111111100110;
		sprite_enemy2_v2[ 7] <= 24'b011111100111111001111110;
		sprite_enemy2_v2[ 8] <= 24'b011111100111111001111110;
		sprite_enemy2_v2[ 9] <= 24'b011111111111111111111110;
		sprite_enemy2_v2[10] <= 24'b011111111111111111111110;
		sprite_enemy2_v2[11] <= 24'b000111111111111111111000;
		sprite_enemy2_v2[12] <= 24'b000111111111111111111000;
		sprite_enemy2_v2[13] <= 24'b000001100000000001100000;
		sprite_enemy2_v2[14] <= 24'b000001100000000001100000;
		sprite_enemy2_v2[15] <= 24'b000110000000000000011000;
		sprite_enemy2_v2[16] <= 24'b000110000000000000011000;
		sprite_enemy2_v2[17] <= 24'b000000000000000000000000;

		sprite_enemy3[ 0] <= 26'b00000000000000000000000000;
		sprite_enemy3[ 1] <= 26'b00000000011111111000000000;
		sprite_enemy3[ 2] <= 26'b00000000011111111000000000;
		sprite_enemy3[ 3] <= 26'b00011111111111111111111000;
		sprite_enemy3[ 4] <= 26'b00011111111111111111111000;
		sprite_enemy3[ 5] <= 26'b01111111111111111111111110;
		sprite_enemy3[ 6] <= 26'b01111111111111111111111110;
		sprite_enemy3[ 7] <= 26'b01111110000111100001111110;
		sprite_enemy3[ 8] <= 26'b01111110000111100001111110;
		sprite_enemy3[ 9] <= 26'b01111111111111111111111110;
		sprite_enemy3[10] <= 26'b01111111111111111111111110;
		sprite_enemy3[11] <= 26'b00000111111000011111100000;
		sprite_enemy3[12] <= 26'b00000111111000011111100000;
		sprite_enemy3[13] <= 26'b00011110000111100001111000;
		sprite_enemy3[14] <= 26'b00011110000111100001111000;
		sprite_enemy3[15] <= 26'b00000111100000000111100000;
		sprite_enemy3[16] <= 26'b00000111100000000111100000;
		sprite_enemy3[17] <= 26'b00000000000000000000000000;

		sprite_enemy3_v2[ 0] <= 26'b00000000000000000000000000;
		sprite_enemy3_v2[ 1] <= 26'b00000000011111111000000000;
		sprite_enemy3_v2[ 2] <= 26'b00000000011111111000000000;
		sprite_enemy3_v2[ 3] <= 26'b00011111111111111111111000;
		sprite_enemy3_v2[ 4] <= 26'b00011111111111111111111000;
		sprite_enemy3_v2[ 5] <= 26'b01111111111111111111111110;
		sprite_enemy3_v2[ 6] <= 26'b01111111111111111111111110;
		sprite_enemy3_v2[ 7] <= 26'b01111110000111100001111110;
		sprite_enemy3_v2[ 8] <= 26'b01111110000111100001111110;
		sprite_enemy3_v2[ 9] <= 26'b01111111111111111111111110;
		sprite_enemy3_v2[10] <= 26'b01111111111111111111111110;
		sprite_enemy3_v2[11] <= 26'b00000001111000011110000000;
		sprite_enemy3_v2[12] <= 26'b00000001111000011110000000;
		sprite_enemy3_v2[13] <= 26'b00000111100111100111100000;
		sprite_enemy3_v2[14] <= 26'b00000111100111100111100000;
		sprite_enemy3_v2[15] <= 26'b01111000000000000000011110;
		sprite_enemy3_v2[16] <= 26'b01111000000000000000011110;
		sprite_enemy3_v2[17] <= 26'b00000000000000000000000000;

		sprite_bonus[ 0] <= 34'b0000000000000000000000000000000000;
		sprite_bonus[ 1] <= 34'b0000000000011111111111100000000000;
		sprite_bonus[ 2] <= 34'b0000000000011111111111100000000000;
		sprite_bonus[ 3] <= 34'b0000000111111111111111111110000000;
		sprite_bonus[ 4] <= 34'b0000000111111111111111111110000000;
		sprite_bonus[ 5] <= 34'b0000011111111111111111111111100000;
		sprite_bonus[ 6] <= 34'b0000011111111111111111111111100000;
		sprite_bonus[ 7] <= 34'b0001111001111001111001111001111000;
		sprite_bonus[ 8] <= 34'b0001111001111001111001111001111000;
		sprite_bonus[ 9] <= 34'b0111111111111111111111111111111110;
		sprite_bonus[10] <= 34'b0111111111111111111111111111111110;
		sprite_bonus[11] <= 34'b0000011111100001111000011111100000;
		sprite_bonus[12] <= 34'b0000011111100001111000011111100000;
		sprite_bonus[13] <= 34'b0000000110000000000000000110000000;
		sprite_bonus[14] <= 34'b0000000110000000000000000110000000;
		sprite_bonus[15] <= 34'b0000000000000000000000000000000000;
		
		sprite_player[ 0] <= 28'b0000000000000000000000000000;
		sprite_player[ 1] <= 28'b0000000000000110000000000000;
		sprite_player[ 2] <= 28'b0000000000000110000000000000;
		sprite_player[ 3] <= 28'b0000000000011111100000000000;
		sprite_player[ 4] <= 28'b0000000000011111100000000000;
		sprite_player[ 5] <= 28'b0000000000011111100000000000;
		sprite_player[ 6] <= 28'b0000000000011111100000000000;
		sprite_player[ 7] <= 28'b0001111111111111111111111000;
		sprite_player[ 8] <= 28'b0001111111111111111111111000;
		sprite_player[ 9] <= 28'b0111111111111111111111111110;
		sprite_player[10] <= 28'b0111111111111111111111111110;
		sprite_player[11] <= 28'b0111111111111111111111111110;
		sprite_player[12] <= 28'b0111111111111111111111111110;
		sprite_player[13] <= 28'b0111111111111111111111111110;
		sprite_player[14] <= 28'b0111111111111111111111111110;
		sprite_player[15] <= 28'b0111111111111111111111111110;
		sprite_player[16] <= 28'b0111111111111111111111111110;
		sprite_player[17] <= 28'b0000000000000000000000000000;
		
		sprite_explosion_player[ 0] <= 28'b0000000000000000000000000000;
		sprite_explosion_player[ 1] <= 28'b0000000000011000000000000000;
		sprite_explosion_player[ 2] <= 28'b0000000000011000000000000000;
		sprite_explosion_player[ 3] <= 28'b0000000000000000000001100000;
		sprite_explosion_player[ 4] <= 28'b0000000000000000000001100000;
		sprite_explosion_player[ 5] <= 28'b0000000000011001100110000000;
		sprite_explosion_player[ 6] <= 28'b0000000000011001100110000000;
		sprite_explosion_player[ 7] <= 28'b0000011000011000000000000000;
		sprite_explosion_player[ 8] <= 28'b0000011000011000000000000000;
		sprite_explosion_player[ 9] <= 28'b0000000000000111100111100000;
		sprite_explosion_player[10] <= 28'b0000000000000111100111100000;
		sprite_explosion_player[11] <= 28'b0110000001100111100110011000;
		sprite_explosion_player[12] <= 28'b0110000001100111100110011000;
		sprite_explosion_player[13] <= 28'b0000011111111111111110000110;
		sprite_explosion_player[14] <= 28'b0000011111111111111110000110;
		sprite_explosion_player[15] <= 28'b0001111111111111111111100110;
		sprite_explosion_player[16] <= 28'b0001111111111111111111100110;
		sprite_explosion_player[17] <= 28'b0000000000000000000000000000;

		sprite_block_v1[ 0] <= 46'b0000000000000000000000000000000000000000000000;
		sprite_block_v1[ 1] <= 46'b0000000000011111111111111111111111111000000000;
		sprite_block_v1[ 2] <= 46'b0000000000011111111111111111111111111000000000;
		sprite_block_v1[ 3] <= 46'b0000000111111111111111111111111111111110000000;
		sprite_block_v1[ 4] <= 46'b0000000111111111111111111111111111111110000000;
		sprite_block_v1[ 5] <= 46'b0000011111111111111111111111111111111111100000;
		sprite_block_v1[ 6] <= 46'b0000011111111111111111111111111111111111100000;
		sprite_block_v1[ 7] <= 46'b0001111111111111111111111111111111111111111000;
		sprite_block_v1[ 8] <= 46'b0001111111111111111111111111111111111111111000;
		sprite_block_v1[ 9] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[10] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[11] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[12] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[13] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[14] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[15] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[16] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[17] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[18] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[19] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[20] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[21] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[22] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[23] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[24] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v1[25] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v1[26] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v1[27] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v1[28] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v1[29] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v1[30] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v1[31] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v1[32] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v1[33] <= 46'b0000000000000000000000000000000000000000000000;

		sprite_block_v2[ 0] <= 46'b0000000000000000000000000000000000000000000000;
		sprite_block_v2[ 1] <= 46'b0000000000011000011111111111111111111000000000;
		sprite_block_v2[ 2] <= 46'b0000000000011000011111111111111111111000000000;
		sprite_block_v2[ 3] <= 46'b0000000111100000000111111111111111111110000000;
		sprite_block_v2[ 4] <= 46'b0000000111100000000111111111111111111110000000;
		sprite_block_v2[ 5] <= 46'b0000011110011000011111111111111111111111100000;
		sprite_block_v2[ 6] <= 46'b0000011110011000011111111111111111111111100000;
		sprite_block_v2[ 7] <= 46'b0001111111100110011001111111111111111111111000;
		sprite_block_v2[ 8] <= 46'b0001111111100110011001111111111111111111111000;
		sprite_block_v2[ 9] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[10] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[11] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[12] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[13] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[14] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[15] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[16] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[17] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[18] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[19] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[20] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[21] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[22] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[23] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[24] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v2[25] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v2[26] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v2[27] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v2[28] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v2[29] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v2[30] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v2[31] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v2[32] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v2[33] <= 46'b0000000000000000000000000000000000000000000000;

		/*
		sprite_block_v3[ 0] <= 46'b0000000000000000000000000000000000000000000000;
		sprite_block_v3[ 1] <= 46'b0000000000011111111111111111111111100000000000;
		sprite_block_v3[ 2] <= 46'b0000000000011111111111111111111111100000000000;
		sprite_block_v3[ 3] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[ 4] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[ 5] <= 46'b0000000000011111111111111111111111100000000000;
		sprite_block_v3[ 6] <= 46'b0000000000011111111111111111111111100000000000;
		sprite_block_v3[ 7] <= 46'b0000000001111111111111111111111110000000000000;
		sprite_block_v3[ 8] <= 46'b0000000001111111111111111111111110000000000000;
		sprite_block_v3[ 9] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[10] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[11] <= 46'b0000000000011111111111111111111110000000000000;
		sprite_block_v3[12] <= 46'b0000000000011111111111111111111110000000000000;
		sprite_block_v3[13] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[14] <= 46'b0000000001111111111111111111111001100000000000;
		sprite_block_v3[15] <= 46'b0001100110011111111111111111111111100110011000;
		sprite_block_v3[16] <= 46'b0001100110011111111111111111111111100110011000;
		sprite_block_v3[17] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[18] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[19] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[20] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[21] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[22] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[23] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[24] <= 46'b0111111111111111111111111111111111111111111110;
		sprite_block_v3[25] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v3[26] <= 46'b0111111111111110000000000000000111111111111110;
		sprite_block_v3[27] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v3[28] <= 46'b0111111111111000000000000000000001111111111110;
		sprite_block_v3[29] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v3[30] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v3[31] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v3[32] <= 46'b0111111111100000000000000000000000011111111110;
		sprite_block_v3[33] <= 46'b0000000000000000000000000000000000000000000000;

		sprite_block_v4[ 0] <= 46'b0000000000000000000000000000000000000000000000;
		sprite_block_v4[ 1] <= 46'b0000000000011000011000000110000001100000000000;
		sprite_block_v4[ 2] <= 46'b0000000000011000011000000110000001100000000000;
		sprite_block_v4[ 3] <= 46'b0000000001111100000000000000000000000000000000;
		sprite_block_v4[ 4] <= 46'b0000000001111100000000000000000000000000000000;
		sprite_block_v4[ 5] <= 46'b0000000000011111100000000000000001100000000000;
		sprite_block_v4[ 6] <= 46'b0000000000011111100000000000000001100000000000;
		sprite_block_v4[ 7] <= 46'b0000000001111110000000000110011110000000000000;
		sprite_block_v4[ 8] <= 46'b0000000001111110000000000110011110000000000000;
		sprite_block_v4[ 9] <= 46'b0000000001111000000000011111111001100000000000;
		sprite_block_v4[10] <= 46'b0000000001111000000000011111111001100000000000;
		sprite_block_v4[11] <= 46'b0000000000011111111111111111111110000000000000;
		sprite_block_v4[12] <= 46'b0000000000011111111111111111111110000000000000;
		sprite_block_v4[13] <= 46'b0000000001100110011001111111111001100000000000;
		sprite_block_v4[14] <= 46'b0000000001100110011001111111111100110000000000;
		sprite_block_v4[15] <= 46'b0001100110011111111111111111111111100110011000;
		sprite_block_v4[16] <= 46'b0001100110011111111111111111111111100110011000;
		sprite_block_v4[17] <= 46'b0111111111111111111111111111111001111110000000;
		sprite_block_v4[18] <= 46'b0111111111111111111111111111111001111110000000;
		sprite_block_v4[19] <= 46'b0111111111111111111111111111111110000000000000;
		sprite_block_v4[20] <= 46'b0111111111111111111111111111111110000000000000;
		sprite_block_v4[21] <= 46'b0111111111111111111111111111111110000000000000;
		sprite_block_v4[22] <= 46'b0111111111111111111111111111111110000000011000;
		sprite_block_v4[23] <= 46'b0111111111111111111111111111111110011000011000;
		sprite_block_v4[24] <= 46'b0111111111111111111111111111111110011000000000;
		sprite_block_v4[25] <= 46'b0111111111111110000000000000000111111110000000;
		sprite_block_v4[26] <= 46'b0111111111111110000000000000000111111110000000;
		sprite_block_v4[27] <= 46'b0111111111111000000000000000000001111000000000;
		sprite_block_v4[28] <= 46'b0111111111111000000000000000000001111000000000;
		sprite_block_v4[29] <= 46'b0111111111100000000000000000000000011000000000;
		sprite_block_v4[30] <= 46'b0111111111100000000000000000000000011000000000;
		sprite_block_v4[31] <= 46'b0111111111100000000000000000000000011110000000;
		sprite_block_v4[32] <= 46'b0111111111100000000000000000000000011110000000;
		sprite_block_v4[33] <= 46'b0000000000000000000000000000000000000000000000;
		*/
		
		sprite_block_v5[ 0] <= 46'b0000000000000000000000000000000000000000000000;
		sprite_block_v5[ 1] <= 46'b0000000000000000000000000110000000000000000000;
		sprite_block_v5[ 2] <= 46'b0000000000000000000000000110000000000000000000;
		sprite_block_v5[ 3] <= 46'b0000000001100000000000000000000000000000000000;
		sprite_block_v5[ 4] <= 46'b0000000001100000000000000000000000000000000000;
		sprite_block_v5[ 5] <= 46'b0000000000011000000000000000000001100000000000;
		sprite_block_v5[ 6] <= 46'b0000000000011000000000000000000001100000000000;
		sprite_block_v5[ 7] <= 46'b0000000001100000000000000110011110000000000000;
		sprite_block_v5[ 8] <= 46'b0000000001100000000000000110011110000000000000;
		sprite_block_v5[ 9] <= 46'b0000000001111000000000011111111001100000000000;
		sprite_block_v5[10] <= 46'b0000000001111000000000011111111001100000000000;
		sprite_block_v5[11] <= 46'b0000000000011111111111111000011110000000000000;
		sprite_block_v5[12] <= 46'b0000000000011111111111111000011110000000000000;
		sprite_block_v5[13] <= 46'b0000000001100110011001111111111001100000000000;
		sprite_block_v5[14] <= 46'b0000000001100110011001111111111100110000000000;
		sprite_block_v5[15] <= 46'b0001100110011111111111000000001111100110011000;
		sprite_block_v5[16] <= 46'b0001100110011111111111000000001111100110011000;
		sprite_block_v5[17] <= 46'b0111100110000000011000000000111001111110000000;
		sprite_block_v5[18] <= 46'b0111100110000000011000000000111001111110000000;
		sprite_block_v5[19] <= 46'b0110000000000000110000000000000110000000000000;
		sprite_block_v5[20] <= 46'b0110000000000000110000000000000110000000000000;
		sprite_block_v5[21] <= 46'b0111111111111111111111111111111110000000000000;
		sprite_block_v5[22] <= 46'b0111100000011100000000011111111110000000011000;
		sprite_block_v5[23] <= 46'b0111100000011100000000011111111110011000011000;
		sprite_block_v5[24] <= 46'b011111000000001100111111111111110011000000000;
		sprite_block_v5[25] <= 46'b0111111111111110000000000000000111111110000000;
		sprite_block_v5[26] <= 46'b0000001100111110000000000000000111111110000000;
		sprite_block_v5[27] <= 46'b0000001100111000000000000000000001111000000000;
		sprite_block_v5[28] <= 46'b0111111111111000000000000000000001111000000000;
		sprite_block_v5[29] <= 46'b0111111111100000000000000000000000011000000000;
		sprite_block_v5[30] <= 46'b0111111111100000000000000000000000011000000000;
		sprite_block_v5[31] <= 46'b0111111111100000000000000000000000011110000000;
		sprite_block_v5[32] <= 46'b0111111111100000000000000000000000011110000000;
		sprite_block_v5[33] <= 46'b0000000000000000000000000000000000000000000000;

		sprite_explosion_enemy1[ 0] <= 18'b000000000000000000;
		sprite_explosion_enemy1[ 1] <= 18'b000000000000000000;
		sprite_explosion_enemy1[ 2] <= 18'b001100001100001100;
		sprite_explosion_enemy1[ 3] <= 18'b001100001100001100;
		sprite_explosion_enemy1[ 4] <= 18'b000011001100110000;
		sprite_explosion_enemy1[ 5] <= 18'b000011001100110000;
		sprite_explosion_enemy1[ 6] <= 18'b000001100001100000;
		sprite_explosion_enemy1[ 7] <= 18'b000001100001100000;
		sprite_explosion_enemy1[ 8] <= 18'b011100000000001110;
		sprite_explosion_enemy1[ 9] <= 18'b011100000000001110;
		sprite_explosion_enemy1[10] <= 18'b000001100001100000;
		sprite_explosion_enemy1[11] <= 18'b000001100001100000;
		sprite_explosion_enemy1[12] <= 18'b000011001100110000;
		sprite_explosion_enemy1[13] <= 18'b000011001100110000;
		sprite_explosion_enemy1[14] <= 18'b001100001100001100;
		sprite_explosion_enemy1[15] <= 18'b001100001100001100;
		sprite_explosion_enemy1[16] <= 18'b000000000000000000;
		sprite_explosion_enemy1[17] <= 18'b000000000000000000;

		sprite_explosion_enemy2[ 0] <= 24'b000000000000000000000000;
		sprite_explosion_enemy2[ 1] <= 24'b000000000000000000000000;
		sprite_explosion_enemy2[ 2] <= 24'b011000011000000110000110;
		sprite_explosion_enemy2[ 3] <= 24'b011000011000000110000110;
		sprite_explosion_enemy2[ 4] <= 24'b000110000110011000011000;
		sprite_explosion_enemy2[ 5] <= 24'b000110000110011000011000;
		sprite_explosion_enemy2[ 6] <= 24'b000001100000000001100000;
		sprite_explosion_enemy2[ 7] <= 24'b000001100000000001100000;
		sprite_explosion_enemy2[ 8] <= 24'b011100000000000000001110;
		sprite_explosion_enemy2[ 9] <= 24'b011100000000000000001110;
		sprite_explosion_enemy2[10] <= 24'b000001100000000001100000;
		sprite_explosion_enemy2[11] <= 24'b000001100000000001100000;
		sprite_explosion_enemy2[12] <= 24'b000110000110011000011000;
		sprite_explosion_enemy2[13] <= 24'b000110000110011000011000;
		sprite_explosion_enemy2[14] <= 24'b011000011000000110000110;
		sprite_explosion_enemy2[15] <= 24'b011000011000000110000110;
		sprite_explosion_enemy2[16] <= 24'b000000000000000000000000;
		sprite_explosion_enemy2[17] <= 24'b000000000000000000000000;

		sprite_explosion_enemy3[ 0] <= 26'b00000000000000000000000000;
		sprite_explosion_enemy3[ 1] <= 26'b00000000000000000000000000;
		sprite_explosion_enemy3[ 2] <= 26'b00110000110000001100001100;
		sprite_explosion_enemy3[ 3] <= 26'b00110000110000001100001100;
		sprite_explosion_enemy3[ 4] <= 26'b00001100001100110000110000;
		sprite_explosion_enemy3[ 5] <= 26'b00001100001100110000110000;
		sprite_explosion_enemy3[ 6] <= 26'b00000011000000000011000000;
		sprite_explosion_enemy3[ 7] <= 26'b00000011000000000011000000;
		sprite_explosion_enemy3[ 8] <= 26'b01110000000000000000001110;
		sprite_explosion_enemy3[ 9] <= 26'b01110000000000000000001110;
		sprite_explosion_enemy3[10] <= 26'b00000011000000000011000000;
		sprite_explosion_enemy3[11] <= 26'b00000011000000000011000000;
		sprite_explosion_enemy3[12] <= 26'b00001100001100110000110000;
		sprite_explosion_enemy3[13] <= 26'b00001100001100110000110000;
		sprite_explosion_enemy3[14] <= 26'b00110000110000001100001100;
		sprite_explosion_enemy3[15] <= 26'b00110000110000001100001100;
		sprite_explosion_enemy3[16] <= 26'b00000000000000000000000000;
		sprite_explosion_enemy3[17] <= 26'b00000000000000000000000000;
		
		sprite_bullet_player[ 0] <= 4'b0000;
		sprite_bullet_player[ 1] <= 4'b0110;
		sprite_bullet_player[ 2] <= 4'b0110;
		sprite_bullet_player[ 3] <= 4'b0110;
		sprite_bullet_player[ 4] <= 4'b0110;
		sprite_bullet_player[ 5] <= 4'b0110;
		sprite_bullet_player[ 6] <= 4'b0110;
		sprite_bullet_player[ 7] <= 4'b0110;
		sprite_bullet_player[ 8] <= 4'b0110;
		sprite_bullet_player[ 9] <= 4'b0000;

		sprite_bullet_enemy_v1[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v1[ 1] <= 8'b00000110;
		sprite_bullet_enemy_v1[ 2] <= 8'b00011000;
		sprite_bullet_enemy_v1[ 3] <= 8'b01100000;
		sprite_bullet_enemy_v1[ 4] <= 8'b00011000;
		sprite_bullet_enemy_v1[ 5] <= 8'b00000110;
		sprite_bullet_enemy_v1[ 6] <= 8'b00011000;
		sprite_bullet_enemy_v1[ 7] <= 8'b01100000;
		sprite_bullet_enemy_v1[ 8] <= 8'b00011000;
		sprite_bullet_enemy_v1[ 9] <= 8'b00000110;
		sprite_bullet_enemy_v1[10] <= 8'b00011000;
		sprite_bullet_enemy_v1[11] <= 8'b01100000;
		sprite_bullet_enemy_v1[12] <= 8'b00000000;

		sprite_bullet_enemy_v2[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v2[ 1] <= 8'b01100000;
		sprite_bullet_enemy_v2[ 2] <= 8'b00011000;
		sprite_bullet_enemy_v2[ 3] <= 8'b00000110;
		sprite_bullet_enemy_v2[ 4] <= 8'b00011000;
		sprite_bullet_enemy_v2[ 5] <= 8'b01100000;
		sprite_bullet_enemy_v2[ 6] <= 8'b00011000;
		sprite_bullet_enemy_v2[ 7] <= 8'b00000110;
		sprite_bullet_enemy_v2[ 8] <= 8'b00011000;
		sprite_bullet_enemy_v2[ 9] <= 8'b01100000;
		sprite_bullet_enemy_v2[10] <= 8'b00011000;
		sprite_bullet_enemy_v2[11] <= 8'b00000110;
		sprite_bullet_enemy_v2[12] <= 8'b00000000;

		sprite_bullet_enemy_v3[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v3[ 1] <= 8'b01111110;
		sprite_bullet_enemy_v3[ 2] <= 8'b01111110;
		sprite_bullet_enemy_v3[ 3] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 4] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 5] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 6] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 7] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 8] <= 8'b00011000;
		sprite_bullet_enemy_v3[ 9] <= 8'b00011000;
		sprite_bullet_enemy_v3[10] <= 8'b00011000;
		sprite_bullet_enemy_v3[11] <= 8'b00011000;
		sprite_bullet_enemy_v3[12] <= 8'b00000000;

		sprite_bullet_enemy_v4[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v4[ 1] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 2] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 3] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 4] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 5] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 6] <= 8'b01111110;
		sprite_bullet_enemy_v4[ 7] <= 8'b01111110;
		sprite_bullet_enemy_v4[ 8] <= 8'b00011000;
		sprite_bullet_enemy_v4[ 9] <= 8'b00011000;
		sprite_bullet_enemy_v4[10] <= 8'b00011000;
		sprite_bullet_enemy_v4[11] <= 8'b00011000;
		sprite_bullet_enemy_v4[12] <= 8'b00000000;

		sprite_bullet_enemy_v5[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v5[ 1] <= 8'b00011110;
		sprite_bullet_enemy_v5[ 2] <= 8'b00011110;
		sprite_bullet_enemy_v5[ 3] <= 8'b01111000;
		sprite_bullet_enemy_v5[ 4] <= 8'b01111000;
		sprite_bullet_enemy_v5[ 5] <= 8'b00011110;
		sprite_bullet_enemy_v5[ 6] <= 8'b00011110;
		sprite_bullet_enemy_v5[ 7] <= 8'b01111000;
		sprite_bullet_enemy_v5[ 8] <= 8'b01111000;
		sprite_bullet_enemy_v5[ 9] <= 8'b00011110;
		sprite_bullet_enemy_v5[10] <= 8'b00011110;
		sprite_bullet_enemy_v5[11] <= 8'b01111000;
		sprite_bullet_enemy_v5[12] <= 8'b00000000;

		sprite_bullet_enemy_v6[ 0] <= 8'b00000000;
		sprite_bullet_enemy_v6[ 1] <= 8'b01111000;
		sprite_bullet_enemy_v6[ 2] <= 8'b01111000;
		sprite_bullet_enemy_v6[ 3] <= 8'b00011110;
		sprite_bullet_enemy_v6[ 4] <= 8'b00011110;
		sprite_bullet_enemy_v6[ 5] <= 8'b01111000;
		sprite_bullet_enemy_v6[ 6] <= 8'b01111000;
		sprite_bullet_enemy_v6[ 7] <= 8'b00011110;
		sprite_bullet_enemy_v6[ 8] <= 8'b00011110;
		sprite_bullet_enemy_v6[ 9] <= 8'b01111000;
		sprite_bullet_enemy_v6[10] <= 8'b01111000;
		sprite_bullet_enemy_v6[11] <= 8'b00011110;
		sprite_bullet_enemy_v6[12] <= 8'b00000000;
	 
	end
	
	always @ (posedge (pclk)) begin
		if (inccredit && credit < 99)
			credit <= credit + 1;
		else if (deccredit && credit > 0)
			credit <= credit - 1;
		//else
			//credit <= 6'b000000;	
		
		credit_b1 <= credit / 10;
		credit_b0 <= credit % 10;
	end
	
	always @ (credit_b1 or credit_b0) begin
		case (credit_b1)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_9[i][j];
					end
				end
			end
			default: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_8[i][j] <= sprite_0[i][j];
					end
				end
			end
		endcase
		
		case (credit_b0)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_9[i][j];
					end
				end
			end
			default: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_9[i][j] <= sprite_0[i][j];
					end
				end
			end
		endcase
		
	end
	
	always @ (posedge (pclk)) begin
		score1_b3 <= Score1 / 1000;
		score1_b2 <= (Score1 % 1000) /100;
		score1_b1 <= ((Score1 % 1000) %100) /10;
		score1_b0 <= ((Score1 % 1000) %100) %10;
	end
	
	always @ (score1_b3 or score1_b2 or score1_b1 or score1_b0) begin
		case (score1_b3)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_0[i][j] <= sprite_9[i][j];
					end
				end
			end
		endcase
		case (score1_b2)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_1[i][j] <= sprite_9[i][j];
					end
				end
			end
		endcase
		case (score1_b1)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_2[i][j] <= sprite_9[i][j];
					end
				end
			end
		endcase
		case (score1_b0)
			4'b0000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_0[i][j];
					end
				end
			end
			4'b0001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_1[i][j];
					end
				end
			end
			4'b0010: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_2[i][j];
					end
				end
			end
			4'b0011: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_3[i][j];
					end
				end
			end
			4'b0100: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_4[i][j];
					end
				end
			end
			4'b0101: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_5[i][j];
					end
				end
			end
			4'b0110: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_6[i][j];
					end
				end
			end
			4'b0111: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_7[i][j];
					end
				end
			end
			4'b1000: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_8[i][j];
					end
				end
			end
			4'b1001: begin
				for (i=0; i<=15; i=i+1) begin
					for (j=0; j<=15; j=j+1)begin
						digit_3[i][j] <= sprite_9[i][j];
					end
				end
			end
		endcase
	end
	
	always @ (posedge (pclk)) begin
		if (!blank) begin
				div <= div + 1;
				//div2 <= div2 + 1;
			
				//letter1: S
				if (((hcounter >= 70) && (hcounter <= 70+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter1_row <= sprite_S[vcounter - line1_v];
					if (letter1_row[70+15-hcounter])
						letter1_on <= 1;
					else
						letter1_on <= 0;
				end
				//letter2: C
				if (((hcounter >= 90) && (hcounter <= 90+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter2_row <= sprite_C[vcounter - line1_v];
					if (letter2_row[90+15-hcounter])
						letter2_on <= 1;
					else
						letter2_on <= 0;
				end
				//letter3: O
				if (((hcounter >= 110) && (hcounter <= 110+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter3_row <= sprite_O[vcounter - line1_v];
					if (letter3_row[110+15-hcounter])
						letter3_on <= 1;
					else
						letter3_on <= 0;
				end
				//letter4: R
				if (((hcounter >= 130) && (hcounter <= 130+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter4_row <= sprite_R[vcounter - line1_v];
					if (letter4_row[130+15-hcounter])
						letter4_on <= 1;
					else
						letter4_on <= 0;
				end
				//letter5: E
				if (((hcounter >= 150) && (hcounter <= 150+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter5_row <= sprite_E[vcounter - line1_v];
					if (letter5_row[150+15-hcounter])
						letter5_on <= 1;
					else
						letter5_on <= 0;
				end
				//letter6: <
				if (((hcounter >= 170) && (hcounter <= 170+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter6_row <= sprite_left_arrow[vcounter - line1_v];
					if (letter6_row[170+15-hcounter])
						letter6_on <= 1;
					else
						letter6_on <= 0;
				end
				//letter7: 1
				if (((hcounter >= 190) && (hcounter <= 190+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter7_row <= sprite_1[vcounter - line1_v];
					if (letter7_row[190+15-hcounter])
						letter7_on <= 1;
					else
						letter7_on <= 0;
				end
				//letter8: >
				if (((hcounter >= 210) && (hcounter <= 210+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter8_row <= sprite_right_arrow[vcounter - line1_v];
					if (letter8_row[210+15-hcounter])
						letter8_on <= 1;
					else
						letter8_on <= 0;
				end
				//letter9: H
				if (((hcounter >= 250) && (hcounter <= 250+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter9_row <= sprite_H[vcounter - line1_v];
					if (letter9_row[250+15-hcounter])
						letter9_on <= 1;
					else
						letter9_on <= 0;
				end
				//letter10: I
				if (((hcounter >= 270) && (hcounter <= 270+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter10_row <= sprite_I[vcounter - line1_v];
					if (letter10_row[270+15-hcounter])
						letter10_on <= 1;
					else
						letter10_on <= 0;
				end
				//letter11: -
				if (((hcounter >= 290) && (hcounter <= 290+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter11_row <= sprite_hyphen[vcounter - line1_v];
					if (letter11_row[290+15-hcounter])
						letter11_on <= 1;
					else
						letter11_on <= 0;
				end
				//letter12: S
				if (((hcounter >= 310) && (hcounter <= 310+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter12_row <= sprite_S[vcounter - line1_v];
					if (letter12_row[310+15-hcounter])
						letter12_on <= 1;
					else
						letter12_on <= 0;
				end
				//letter13: C
				if (((hcounter >= 330) && (hcounter <= 330+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter13_row <= sprite_C[vcounter - line1_v];
					if (letter13_row[330+15-hcounter])
						letter13_on <= 1;
					else
						letter13_on <= 0;
				end
				//letter14: O
				if (((hcounter >= 350) && (hcounter <= 350+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter14_row <= sprite_O[vcounter - line1_v];
					if (letter14_row[350+15-hcounter])
						letter14_on <= 1;
					else
						letter14_on <= 0;
				end
				//letter15: R
				if (((hcounter >= 370) && (hcounter <= 370+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter15_row <= sprite_R[vcounter - line1_v];
					if (letter15_row[370+15-hcounter])
						letter15_on <= 1;
					else
						letter15_on <= 0;
				end
				//letter16: E
				if (((hcounter >= 390) && (hcounter <= 390+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter16_row <= sprite_E[vcounter - line1_v];
					if (letter16_row[390+15-hcounter])
						letter16_on <= 1;
					else
						letter16_on <= 0;
				end
				//letter17: S
				if (((hcounter >= 430) && (hcounter <= 430+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter17_row <= sprite_S[vcounter - line1_v];
					if (letter17_row[430+15-hcounter])
						letter17_on <= 1;
					else
						letter17_on <= 0;
				end
				//letter18: C
				if (((hcounter >= 450) && (hcounter <= 450+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter18_row <= sprite_C[vcounter - line1_v];
					if (letter18_row[450+15-hcounter])
						letter18_on <= 1;
					else
						letter18_on <= 0;
				end
				//letter19: O
				if (((hcounter >= 470) && (hcounter <= 470+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter19_row <= sprite_O[vcounter - line1_v];
					if (letter19_row[470+15-hcounter])
						letter19_on <= 1;
					else
						letter19_on <= 0;
				end
				//letter20: R
				if (((hcounter >= 490) && (hcounter <= 490+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter20_row <= sprite_R[vcounter - line1_v];
					if (letter20_row[490+15-hcounter])
						letter20_on <= 1;
					else
						letter20_on <= 0;
				end
				//letter21: E
				if (((hcounter >= 510) && (hcounter <= 510+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter21_row <= sprite_E[vcounter - line1_v];
					if (letter21_row[510+15-hcounter])
						letter21_on <= 1;
					else
						letter21_on <= 0;
				end
				//lette22: <
				if (((hcounter >= 530) && (hcounter <= 530+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter22_row <= sprite_left_arrow[vcounter - line1_v];
					if (letter22_row[530+15-hcounter])
						letter22_on <= 1;
					else
						letter22_on <= 0;
				end
				//letter23: 2
				if (((hcounter >= 550) && (hcounter <= 550+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter23_row <= sprite_2[vcounter - line1_v];
					if (letter23_row[550+15-hcounter])
						letter23_on <= 1;
					else
						letter23_on <= 0;
				end
				//letter24: >
				if (((hcounter >= 570) && (hcounter <= 570+15)) && ((vcounter >= line1_v) && (vcounter <= line1_v+15)))begin
					letter24_row <= sprite_right_arrow[vcounter - line1_v];
					if (letter24_row[570+15-hcounter])
						letter24_on <= 1;
					else
						letter24_on <= 0;
				end
				//digit 0
				if (((hcounter >= 110) && (hcounter <= 110+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit0_row <= digit_0[vcounter - line2_v];
					if (digit0_row[110+15-hcounter])
						digit0_on <= 1;
					else
						digit0_on <= 0;
				end
				//digit 1
				else if (((hcounter >= 130) && (hcounter <= 130+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit1_row <= digit_1[vcounter - line2_v];
					if (digit1_row[130+15-hcounter])
						digit1_on <= 1;
					else
						digit1_on <= 0;
				end
				//digit 2
				else if (((hcounter >= 150) && (hcounter <= 150+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit2_row <= digit_2[vcounter - line2_v];
					if (digit2_row[150+15-hcounter])
						digit2_on <= 1;
					else
						digit2_on <= 0;
				end
				//digit 3
				else if (((hcounter >= 170) && (hcounter <= 170+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit3_row <= digit_3[vcounter - line2_v];
					if (digit3_row[170+15-hcounter])
						digit3_on <= 1;
					else
						digit3_on <= 0;
				end
				//digit 4
				else if (((hcounter >= 270) && (hcounter <= 270+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit4_row <= sprite_0[vcounter - line2_v];
					if (digit4_row[270+15-hcounter])
						digit4_on <= 1;
					else
						digit4_on <= 0;
				end
				//digit 5
				else if (((hcounter >= 290) && (hcounter <= 290+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit5_row <= sprite_0[vcounter - line2_v];
					if (digit5_row[290+15-hcounter])
						digit5_on <= 1;
					else
						digit5_on <= 0;
				end
				//digit 6
				else if (((hcounter >= 310) && (hcounter <= 310+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit6_row <= sprite_0[vcounter - line2_v];
					if (digit6_row[310+15-hcounter])
						digit6_on <= 1;
					else
						digit6_on <= 0;
				end
				//digit 7
				else if (((hcounter >= 330) && (hcounter <= 330+15)) && ((vcounter >= line2_v) && (vcounter <= line2_v+15)))begin
					digit7_row <= sprite_0[vcounter - line2_v];
					if (digit7_row[330+15-hcounter])
						digit7_on <= 1;
					else
						digit7_on <= 0;
				end
				//C
				else if (((hcounter >= 390) && (hcounter <= 390+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter25_row <= sprite_C[vcounter - line3_v];
					if (letter25_row[390+15-hcounter])
						letter25_on <= 1;
					else
						letter25_on <= 0;
				end
				//R
				else if (((hcounter >= 410) && (hcounter <= 410+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter26_row <= sprite_R[vcounter - line3_v];
					if (letter26_row[410+15-hcounter])
						letter26_on <= 1;
					else
						letter26_on <= 0;
				end
				//E
				else if (((hcounter >= 430) && (hcounter <= 430+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter27_row <= sprite_E[vcounter - line3_v];
					if (letter27_row[430+15-hcounter])
						letter27_on <= 1;
					else
						letter27_on <= 0;
				end
				//D
				else if (((hcounter >= 450) && (hcounter <= 450+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter28_row <= sprite_D[vcounter - line3_v];
					if (letter28_row[450+15-hcounter])
						letter28_on <= 1;
					else
						letter28_on <= 0;
				end
				//I
				else if (((hcounter >= 470) && (hcounter <= 470+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter29_row <= sprite_I[vcounter - line3_v];
					if (letter29_row[470+15-hcounter])
						letter29_on <= 1;
					else
						letter29_on <= 0;
				end
				//T
				else if (((hcounter >= 490) && (hcounter <= 490+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					letter30_row <= sprite_T[vcounter - line3_v];
					if (letter30_row[490+15-hcounter])
						letter30_on <= 1;
					else
						letter30_on <= 0;
				end
				//digit 8
				else if (((hcounter >= 530) && (hcounter <= 530+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					digit8_row <= digit_8[vcounter - line3_v];
					if (digit8_row[530+15-hcounter])
						digit8_on <= 1;
					else
						digit8_on <= 0;
				end
				//digit 9
				else if (((hcounter >= 550) && (hcounter <= 550+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					digit9_row <= digit_9[vcounter - line3_v];
					if (digit9_row[550+15-hcounter])
						digit9_on <= 1;
					else
						digit9_on <= 0;
				end
				//enemy11
				else if (((hcounter >= Alienpos[21:11]) && (hcounter <= Alienpos[21:11]+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy11_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy11_row[Alienpos[21:11]+17-hcounter]) && (Alienstat[21-0]))
							enemy11_on <= 1;
						else
							enemy11_on <= 0;
					end
					else begin
						enemy11_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy11_row[Alienpos[21:11]+17-hcounter]) && (Alienstat[21-0]))
							enemy11_on <= 1;
						else
							enemy11_on <= 0;
					end
				end
				//enemy12
				else if (((hcounter >= Alienpos[21:11]+38) && (hcounter <= Alienpos[21:11]+38+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy12_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy12_row[Alienpos[21:11]+38+17-hcounter]) && (Alienstat[21-1]))
							enemy12_on <= 1;
						else
							enemy12_on <= 0;
					end
					else begin
						enemy12_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy12_row[Alienpos[21:11]+38+17-hcounter]) && (Alienstat[21-1]))
							enemy12_on <= 1;
						else
							enemy12_on <= 0;
					end
				end
				//enemy13
				else if (((hcounter >= Alienpos[21:11]+76) && (hcounter <= Alienpos[21:11]+76+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy13_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy13_row[Alienpos[21:11]+76+17-hcounter]) && (Alienstat[21-2]))
							enemy13_on <= 1;
						else
							enemy13_on <= 0;
					end
					else begin
						enemy13_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy13_row[Alienpos[21:11]+76+17-hcounter]) && (Alienstat[21-2]))
							enemy13_on <= 1;
						else
							enemy13_on <= 0;
					end		
				end
				//enemy14
				else if (((hcounter >= Alienpos[21:11]+114) && (hcounter <= Alienpos[21:11]+114+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy14_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy14_row[Alienpos[21:11]+114+17-hcounter]) && (Alienstat[21-3]))
							enemy14_on <= 1;
						else
							enemy14_on <= 0;
					end
					else begin
						enemy14_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy14_row[Alienpos[21:11]+114+17-hcounter]) && (Alienstat[21-3]))
							enemy14_on <= 1;
						else
							enemy14_on <= 0;
					end
				end
				//enemy15
				else if (((hcounter >= Alienpos[21:11]+152) && (hcounter <= Alienpos[21:11]+152+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy15_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy15_row[Alienpos[21:11]+152+17-hcounter]) && (Alienstat[21-4]))
							enemy15_on <= 1;
						else
							enemy15_on <= 0;
					end
					else begin
						enemy15_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy15_row[Alienpos[21:11]+152+17-hcounter]) && (Alienstat[21-4]))
							enemy15_on <= 1;
						else
							enemy15_on <= 0;
					end
				end
				
				
				//enemy16
				else if (((hcounter >= Alienpos[21:11]+190) && (hcounter <= Alienpos[21:11]+190+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy16_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy16_row[Alienpos[21:11]+190+17-hcounter]) && (Alienstat[21-5]))
							enemy16_on <= 1;
						else
							enemy16_on <= 0;
					end
					else begin
						enemy16_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy16_row[Alienpos[21:11]+190+17-hcounter]) && (Alienstat[21-5]))
							enemy16_on <= 1;
						else
							enemy16_on <= 0;
					end
				end
				//enemy17
				else if (((hcounter >= Alienpos[21:11]+228) && (hcounter <= Alienpos[21:11]+228+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy17_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy17_row[Alienpos[21:11]+228+17-hcounter]) && (Alienstat[21-6]))
							enemy17_on <= 1;
						else
							enemy17_on <= 0;
					end
					else begin
						enemy17_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy17_row[Alienpos[21:11]+228+17-hcounter]) && (Alienstat[21-6]))
							enemy17_on <= 1;
						else
							enemy17_on <= 0;
					end
				end
				//enemy18
				else if (((hcounter >= Alienpos[21:11]+266) && (hcounter <= Alienpos[21:11]+266+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy18_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy18_row[Alienpos[21:11]+266+17-hcounter]) && (Alienstat[21-7]))
							enemy18_on <= 1;
						else
							enemy18_on <= 0;
					end
					else begin
						enemy18_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy18_row[Alienpos[21:11]+266+17-hcounter]) && (Alienstat[21-7]))
							enemy18_on <= 1;
						else
							enemy18_on <= 0;
					end
				end
				//enemy19
				else if (((hcounter >= Alienpos[21:11]+304) && (hcounter <= Alienpos[21:11]+304+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy19_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy19_row[Alienpos[21:11]+304+17-hcounter]) && (Alienstat[21-8]))
							enemy19_on <= 1;
						else
							enemy19_on <= 0;
					end
					else begin
						enemy19_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy19_row[Alienpos[21:11]+304+17-hcounter]) && (Alienstat[21-8]))
							enemy19_on <= 1;
						else
							enemy19_on <= 0;
					end
				end
				//enemy1a
				else if (((hcounter >= Alienpos[21:11]+342) && (hcounter <= Alienpos[21:11]+342+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy1a_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy1a_row[Alienpos[21:11]+342+17-hcounter]) && (Alienstat[21-9]))
							enemy1a_on <= 1;
						else
							enemy1a_on <= 0;
					end
					else begin
						enemy1a_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy1a_row[Alienpos[21:11]+342+17-hcounter]) && (Alienstat[21-9]))
							enemy1a_on <= 1;
						else
							enemy1a_on <= 0;
					end
				end
				//enemy1b
				else if (((hcounter >= Alienpos[21:11]+380) && (hcounter <= Alienpos[21:11]+380+17)) && ((vcounter >= Alienpos[10:0]) && (vcounter <= Alienpos[10:0]+17)))begin
					if (div[24]) begin
						enemy1b_row <= sprite_enemy1[vcounter - Alienpos[10:0]];
						if ((enemy1b_row[Alienpos[21:11]+380+17-hcounter]) && (Alienstat[21-10]))
							enemy1b_on <= 1;
						else
							enemy1b_on <= 0;
					end
					else begin
						enemy1b_row <= sprite_enemy1_v2[vcounter - Alienpos[10:0]];
						if ((enemy1b_row[Alienpos[21:11]+380+17-hcounter]) && (Alienstat[21-10]))
							enemy1b_on <= 1;
						else
							enemy1b_on <= 0;
					end
				end
				//enemy211
				else if (((hcounter >= Alienpos[21:11]) && (hcounter <= Alienpos[21:11]+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy211_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy211_row[Alienpos[21:11]+23-hcounter]) && (Alienstat[21-11]))
							enemy211_on <= 1;
						else
							enemy211_on <= 0;
					end
					else begin
						enemy211_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy211_row[Alienpos[21:11]+23-hcounter]) && (Alienstat[21-11]))
							enemy211_on <= 1;
						else
							enemy211_on <= 0;
					end
				end
				//enemy212
				else if (((hcounter >= Alienpos[21:11]+38) && (hcounter <= Alienpos[21:11]+38+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy212_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy212_row[Alienpos[21:11]+38+23-hcounter]) && (Alienstat[21-12]))
							enemy212_on <= 1;
						else
							enemy212_on <= 0;
					end
					else begin
						enemy212_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy212_row[Alienpos[21:11]+38+23-hcounter]) && (Alienstat[21-12]))
							enemy212_on <= 1;
						else
							enemy212_on <= 0;
					end
				end
				//enemy213
				else if (((hcounter >= Alienpos[21:11]+76) && (hcounter <= Alienpos[21:11]+76+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy213_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy213_row[Alienpos[21:11]+76+23-hcounter]) && (Alienstat[21-13]))
							enemy213_on <= 1;
						else
							enemy213_on <= 0;
					end
					else begin
						enemy213_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy213_row[Alienpos[21:11]+76+23-hcounter]) && (Alienstat[21-13]))
							enemy213_on <= 1;
						else
							enemy213_on <= 0;
					end
				end
				//enemy214
				else if (((hcounter >= Alienpos[21:11]+114) && (hcounter <= Alienpos[21:11]+114+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy214_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy214_row[Alienpos[21:11]+114+23-hcounter]) && (Alienstat[21-14]))
							enemy214_on <= 1;
						else
							enemy214_on <= 0;
					end
					else begin
						enemy214_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy214_row[Alienpos[21:11]+114+23-hcounter]) && (Alienstat[21-14]))
							enemy214_on <= 1;
						else
							enemy214_on <= 0;
					end
				end
				//enemy215
				else if (((hcounter >= Alienpos[21:11]+152) && (hcounter <= Alienpos[21:11]+152+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy215_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy215_row[Alienpos[21:11]+152+23-hcounter]) && (Alienstat[21-15]))
							enemy215_on <= 1;
						else
							enemy215_on <= 0;
					end
					else begin
						enemy215_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy215_row[Alienpos[21:11]+152+23-hcounter]) && (Alienstat[21-15]))
							enemy215_on <= 1;
						else
							enemy215_on <= 0;
					end
				end
				//enemy216
				else if (((hcounter >= Alienpos[21:11]+190) && (hcounter <= Alienpos[21:11]+190+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy216_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy216_row[Alienpos[21:11]+190+23-hcounter]) && (Alienstat[21-16]))
							enemy216_on <= 1;
						else
							enemy216_on <= 0;
					end
					else begin
						enemy216_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy216_row[Alienpos[21:11]+190+23-hcounter]) && (Alienstat[21-16]))
							enemy216_on <= 1;
						else
							enemy216_on <= 0;
					end
				end
				//enemy217
				else if (((hcounter >= Alienpos[21:11]+228) && (hcounter <= Alienpos[21:11]+228+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy217_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy217_row[Alienpos[21:11]+228+23-hcounter]) && (Alienstat[21-17]))
							enemy217_on <= 1;
						else
							enemy217_on <= 0;
					end
					else begin
						enemy217_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy217_row[Alienpos[21:11]+228+23-hcounter]) && (Alienstat[21-17]))
							enemy217_on <= 1;
						else
							enemy217_on <= 0;
					end
				end
				//enemy218
				else if (((hcounter >= Alienpos[21:11]+266) && (hcounter <= Alienpos[21:11]+266+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy218_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy218_row[Alienpos[21:11]+266+23-hcounter]) && (Alienstat[21-18]))
							enemy218_on <= 1;
						else
							enemy218_on <= 0;
					end
					else begin
						enemy218_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy218_row[Alienpos[21:11]+266+23-hcounter]) && (Alienstat[21-18]))
							enemy218_on <= 1;
						else
							enemy218_on <= 0;
					end
				end
				//enemy219
				else if (((hcounter >= Alienpos[21:11]+304) && (hcounter <= Alienpos[21:11]+304+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy219_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy219_row[Alienpos[21:11]+304+23-hcounter]) && (Alienstat[21-19]))
							enemy219_on <= 1;
						else
							enemy219_on <= 0;
					end
					else begin
						enemy219_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy219_row[Alienpos[21:11]+304+23-hcounter]) && (Alienstat[21-19]))
							enemy219_on <= 1;
						else
							enemy219_on <= 0;
					end
				end
				//enemy21a
				else if (((hcounter >= Alienpos[21:11]+342) && (hcounter <= Alienpos[21:11]+342+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy21a_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy21a_row[Alienpos[21:11]+342+23-hcounter]) && (Alienstat[21-20]))
							enemy21a_on <= 1;
						else
							enemy21a_on <= 0;
					end
					else begin
						enemy21a_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy21a_row[Alienpos[21:11]+342+23-hcounter]) && (Alienstat[21-20]))
							enemy21a_on <= 1;
						else
							enemy21a_on <= 0;
					end
				end
				//enemy21b
				else if (((hcounter >= Alienpos[21:11]+380) && (hcounter <= Alienpos[21:11]+380+23)) && ((vcounter >= Alienpos[10:0]+35) && (vcounter <= Alienpos[10:0]+35+17)))begin
					if (div[24]) begin
						enemy21b_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy21b_row[Alienpos[21:11]+380+23-hcounter]) && (Alienstat[21-21]))
							enemy21b_on <= 1;
						else
							enemy21b_on <= 0;
					end
					else begin
						enemy21b_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+35)];
						if ((enemy21b_row[Alienpos[21:11]+380+23-hcounter]) && (Alienstat[21-21]))
							enemy21b_on <= 1;
						else
							enemy21b_on <= 0;
					end
				end
				/*
				//enemy221
				else if (((hcounter >= Alienpos[21:11]) && (hcounter <= Alienpos[21:11]+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy221_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy221_row[Alienpos[21:11]+23-hcounter]) && (Alienstat[22]))
							enemy221_on <= 1;
						else
							enemy221_on <= 0;
					end
					else begin
						enemy221_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy221_row[Alienpos[21:11]+23-hcounter]) && (Alienstat[22]))
							enemy221_on <= 1;
						else
							enemy221_on <= 0;
					end
				end
				//enemy222
				else if (((hcounter >= Alienpos[21:11]+38) && (hcounter <= Alienpos[21:11]+38+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy222_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy222_row[Alienpos[21:11]+38+23-hcounter]) && (Alienstat[23]))
							enemy222_on <= 1;
						else
							enemy222_on <= 0;
					end
					else begin
						enemy222_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy222_row[Alienpos[21:11]+38+23-hcounter]) && (Alienstat[23]))
							enemy222_on <= 1;
						else
							enemy222_on <= 0;
					end
				end
				//enemy223
				else if (((hcounter >= Alienpos[21:11]+76) && (hcounter <= Alienpos[21:11]+76+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy223_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy223_row[Alienpos[21:11]+76+23-hcounter]) && (Alienstat[24]))
							enemy223_on <= 1;
						else
							enemy223_on <= 0;
					end
					else begin
						enemy223_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy223_row[Alienpos[21:11]+76+23-hcounter]) && (Alienstat[24]))
							enemy223_on <= 1;
						else
							enemy223_on <= 0;
					end
				end
				//enemy224
				else if (((hcounter >= Alienpos[21:11]+114) && (hcounter <= Alienpos[21:11]+114+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy224_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy224_row[Alienpos[21:11]+114+23-hcounter]) && (Alienstat[25]))
							enemy224_on <= 1;
						else
							enemy224_on <= 0;
					end
					else begin
						enemy224_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy224_row[Alienpos[21:11]+114+23-hcounter]) && (Alienstat[25]))
							enemy224_on <= 1;
						else
							enemy224_on <= 0;
					end
				end
				//enemy225
				else if (((hcounter >= Alienpos[21:11]+152) && (hcounter <= Alienpos[21:11]+152+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy225_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy225_row[Alienpos[21:11]+152+23-hcounter]) && (Alienstat[26]))
							enemy225_on <= 1;
						else
							enemy225_on <= 0;
					end
					else begin
						enemy225_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy225_row[Alienpos[21:11]+152+23-hcounter]) && (Alienstat[26]))
							enemy225_on <= 1;
						else
							enemy225_on <= 0;
					end
				end
				//enemy226
				else if (((hcounter >= Alienpos[21:11]+190) && (hcounter <= Alienpos[21:11]+190+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy226_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy226_row[Alienpos[21:11]+190+23-hcounter]) && (Alienstat[27]))
							enemy226_on <= 1;
						else
							enemy226_on <= 0;
					end
					else begin
						enemy226_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy226_row[Alienpos[21:11]+190+23-hcounter]) && (Alienstat[27]))
							enemy226_on <= 1;
						else
							enemy226_on <= 0;
					end
				end
				//enemy227
				else if (((hcounter >= Alienpos[21:11]+228) && (hcounter <= Alienpos[21:11]+228+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy227_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy227_row[Alienpos[21:11]+228+23-hcounter]) && (Alienstat[28]))
							enemy227_on <= 1;
						else
							enemy227_on <= 0;
					end
					else begin
						enemy227_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy227_row[Alienpos[21:11]+228+23-hcounter]) && (Alienstat[28]))
							enemy227_on <= 1;
						else
							enemy227_on <= 0;
					end
				end
				//enemy228
				else if (((hcounter >= Alienpos[21:11]+266) && (hcounter <= Alienpos[21:11]+266+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy228_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy228_row[Alienpos[21:11]+266+23-hcounter]) && (Alienstat[29]))
							enemy228_on <= 1;
						else
							enemy228_on <= 0;
					end
					else begin
						enemy228_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy228_row[Alienpos[21:11]+266+23-hcounter]) && (Alienstat[29]))
							enemy228_on <= 1;
						else
							enemy228_on <= 0;
					end
				end
				//enemy229
				else if (((hcounter >= Alienpos[21:11]+304) && (hcounter <= Alienpos[21:11]+304+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy229_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy229_row[Alienpos[21:11]+304+23-hcounter]) && (Alienstat[30]))
							enemy229_on <= 1;
						else
							enemy229_on <= 0;
					end
					else begin
						enemy229_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy229_row[Alienpos[21:11]+304+23-hcounter]) && (Alienstat[30]))
							enemy229_on <= 1;
						else
							enemy229_on <= 0;
					end
				end
				//enemy22a
				else if (((hcounter >= Alienpos[21:11]+342) && (hcounter <= Alienpos[21:11]+342+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy22a_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy22a_row[Alienpos[21:11]+342+23-hcounter]) && (Alienstat[31]))
							enemy22a_on <= 1;
						else
							enemy22a_on <= 0;
					end
					else begin
						enemy22a_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy22a_row[Alienpos[21:11]+342+23-hcounter]) && (Alienstat[31]))
							enemy22a_on <= 1;
						else
							enemy22a_on <= 0;
					end
				end
				//enemy22b
				else if (((hcounter >= Alienpos[21:11]+380) && (hcounter <= Alienpos[21:11]+380+23)) && ((vcounter >= (Alienpos[10:0]+70)) && (vcounter <= (Alienpos[10:0]+70)+17)))begin
					if (div[24]) begin
						enemy22b_row <= sprite_enemy2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy22b_row[Alienpos[21:11]+380+23-hcounter]) && (Alienstat[32]))
							enemy22b_on <= 1;
						else
							enemy22b_on <= 0;
					end
					else begin
						enemy22b_row <= sprite_enemy2_v2[vcounter - (Alienpos[10:0]+70)];
						if ((enemy22b_row[Alienpos[21:11]+380+23-hcounter]) && (Alienstat[32]))
							enemy22b_on <= 1;
						else
							enemy22b_on <= 0;
					end
				end
				//enemy311
				else if (((hcounter >= Alienpos[21:11]) && (hcounter <= Alienpos[21:11]+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy311_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy311_row[Alienpos[21:11]+25-hcounter]) && (Alienstat[33]))
							enemy311_on <= 1;
						else
							enemy311_on <= 0;
					end
					else begin
					enemy311_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy311_row[Alienpos[21:11]+25-hcounter]) && (Alienstat[33]))
							enemy311_on <= 1;
						else
							enemy311_on <= 0;
					end
				end
				//enemy312
				else if (((hcounter >= Alienpos[21:11]+38) && (hcounter <= Alienpos[21:11]+38+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy312_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy312_row[Alienpos[21:11]+38+25-hcounter]) && (Alienstat[34]))
							enemy312_on <= 1;
						else
							enemy312_on <= 0;
					end
					else begin
					enemy312_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy312_row[Alienpos[21:11]+38+25-hcounter]) && (Alienstat[34]))
							enemy312_on <= 1;
						else
							enemy312_on <= 0;
					end
				end
				//enemy313
				else if (((hcounter >= Alienpos[21:11]+76) && (hcounter <= Alienpos[21:11]+76+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy313_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy313_row[Alienpos[21:11]+76+25-hcounter]) && (Alienstat[35]))
							enemy313_on <= 1;
						else
							enemy313_on <= 0;
					end
					else begin
					enemy313_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy313_row[Alienpos[21:11]+76+25-hcounter]) && (Alienstat[35]))
							enemy313_on <= 1;
						else
							enemy313_on <= 0;
					end
				end
				//enemy314
				else if (((hcounter >= Alienpos[21:11]+114) && (hcounter <= Alienpos[21:11]+114+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy314_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy314_row[Alienpos[21:11]+114+25-hcounter]) && (Alienstat[36]))
							enemy314_on <= 1;
						else
							enemy314_on <= 0;
					end
					else begin
					enemy314_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy314_row[Alienpos[21:11]+114+25-hcounter]) && (Alienstat[36]))
							enemy314_on <= 1;
						else
							enemy314_on <= 0;
					end
				end
				//enemy315
				else if (((hcounter >= Alienpos[21:11]+152) && (hcounter <= Alienpos[21:11]+152+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy315_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy315_row[Alienpos[21:11]+152+25-hcounter]) && (Alienstat[37]))
							enemy315_on <= 1;
						else
							enemy315_on <= 0;
					end
					else begin
					enemy315_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy315_row[Alienpos[21:11]+152+25-hcounter]) && (Alienstat[37]))
							enemy315_on <= 1;
						else
							enemy315_on <= 0;
					end
				end
				//enemy316
				else if (((hcounter >= Alienpos[21:11]+190) && (hcounter <= Alienpos[21:11]+190+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy316_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy316_row[Alienpos[21:11]+190+25-hcounter]) && (Alienstat[38]))
							enemy316_on <= 1;
						else
							enemy316_on <= 0;
					end
					else begin
					enemy316_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy316_row[Alienpos[21:11]+190+25-hcounter]) && (Alienstat[38]))
							enemy316_on <= 1;
						else
							enemy316_on <= 0;
					end
				end
				//enemy317
				else if (((hcounter >= Alienpos[21:11]+228) && (hcounter <= Alienpos[21:11]+228+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy317_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy317_row[Alienpos[21:11]+228+25-hcounter]) && (Alienstat[39]))
							enemy317_on <= 1;
						else
							enemy317_on <= 0;
					end
					else begin
					enemy317_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy317_row[Alienpos[21:11]+228+25-hcounter]) && (Alienstat[39]))
							enemy317_on <= 1;
						else
							enemy317_on <= 0;
					end
				end
				//enemy318
				else if (((hcounter >= Alienpos[21:11]+266) && (hcounter <= Alienpos[21:11]+266+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy318_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy318_row[Alienpos[21:11]+266+25-hcounter]) && (Alienstat[40]))
							enemy318_on <= 1;
						else
							enemy318_on <= 0;
					end
					else begin
					enemy318_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy318_row[Alienpos[21:11]+266+25-hcounter]) && (Alienstat[40]))
							enemy318_on <= 1;
						else
							enemy318_on <= 0;
					end
				end
				//enemy319
				else if (((hcounter >= Alienpos[21:11]+304) && (hcounter <= Alienpos[21:11]+304+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy319_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy319_row[Alienpos[21:11]+304+25-hcounter]) && (Alienstat[41]))
							enemy319_on <= 1;
						else
							enemy319_on <= 0;
					end
					else begin
					enemy319_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy319_row[Alienpos[21:11]+304+25-hcounter]) && (Alienstat[41]))
							enemy319_on <= 1;
						else
							enemy319_on <= 0;
					end
				end
				//enemy31a
				else if (((hcounter >= Alienpos[21:11]+342) && (hcounter <= Alienpos[21:11]+342+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy31a_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy31a_row[Alienpos[21:11]+342+25-hcounter]) && (Alienstat[42]))
							enemy31a_on <= 1;
						else
							enemy31a_on <= 0;
					end
					else begin
					enemy31a_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy31a_row[Alienpos[21:11]+342+25-hcounter]) && (Alienstat[42]))
							enemy31a_on <= 1;
						else
							enemy31a_on <= 0;
					end
				end
				//enemy31b
				else if (((hcounter >= Alienpos[21:11]+380) && (hcounter <= Alienpos[21:11]+380+25)) && ((vcounter >= (Alienpos[10:0]+105)) && (vcounter <= (Alienpos[10:0]+105)+17)))begin
					if (div[24]) begin
						enemy31b_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+105)];
						if ((enemy31b_row[Alienpos[21:11]+380+25-hcounter]) && (Alienstat[43]))
							enemy31b_on <= 1;
						else
							enemy31b_on <= 0;
					end
					else begin
					enemy31b_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+105)];
						if ((enemy31b_row[Alienpos[21:11]+380+25-hcounter]) && (Alienstat[43]))
							enemy31b_on <= 1;
						else
							enemy31b_on <= 0;
					end
				end
				//enemy321
				else if (((hcounter >= Alienpos[21:11]) && (hcounter <= Alienpos[21:11]+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy321_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy321_row[Alienpos[21:11]+25-hcounter]) && (Alienstat[44]))
							enemy321_on <= 1;
						else
							enemy321_on <= 0;
					end
					else begin
						enemy321_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy321_row[Alienpos[21:11]+25-hcounter]) && (Alienstat[44]))
							enemy321_on <= 1;
						else
							enemy321_on <= 0;
					end
				end
				//enemy322
				else if (((hcounter >= Alienpos[21:11]+38) && (hcounter <= Alienpos[21:11]+38+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy322_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy322_row[Alienpos[21:11]+38+25-hcounter]) && (Alienstat[45]))
							enemy322_on <= 1;
						else
							enemy322_on <= 0;
					end
					else begin
						enemy322_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy322_row[Alienpos[21:11]+38+25-hcounter]) && (Alienstat[45]))
							enemy322_on <= 1;
						else
							enemy322_on <= 0;
					end
				end
				//enemy323
				else if (((hcounter >= Alienpos[21:11]+76) && (hcounter <= Alienpos[21:11]+76+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy323_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy323_row[Alienpos[21:11]+76+25-hcounter]) && (Alienstat[46]))
							enemy323_on <= 1;
						else
							enemy323_on <= 0;
					end
					else begin
						enemy323_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy323_row[Alienpos[21:11]+76+25-hcounter]) && (Alienstat[46]))
							enemy323_on <= 1;
						else
							enemy323_on <= 0;
					end
				end
				//enemy324
				else if (((hcounter >= Alienpos[21:11]+114) && (hcounter <= Alienpos[21:11]+114+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy324_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy324_row[Alienpos[21:11]+114+25-hcounter]) && (Alienstat[47]))
							enemy324_on <= 1;
						else
							enemy324_on <= 0;
					end
					else begin
						enemy324_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy324_row[Alienpos[21:11]+114+25-hcounter]) && (Alienstat[47]))
							enemy324_on <= 1;
						else
							enemy324_on <= 0;
					end
				end
				//enemy325
				else if (((hcounter >= Alienpos[21:11]+152) && (hcounter <= Alienpos[21:11]+152+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy325_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy325_row[Alienpos[21:11]+152+25-hcounter]) && (Alienstat[48]))
							enemy325_on <= 1;
						else
							enemy325_on <= 0;
					end
					else begin
						enemy325_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy325_row[Alienpos[21:11]+152+25-hcounter]) && (Alienstat[48]))
							enemy325_on <= 1;
						else
							enemy325_on <= 0;
					end
				end
				//enemy326
				else if (((hcounter >= Alienpos[21:11]+190) && (hcounter <= Alienpos[21:11]+190+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy326_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy326_row[Alienpos[21:11]+190+25-hcounter]) && (Alienstat[49]))
							enemy326_on <= 1;
						else
							enemy326_on <= 0;
					end
					else begin
						enemy326_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy326_row[Alienpos[21:11]+190+25-hcounter]) && (Alienstat[49]))
							enemy326_on <= 1;
						else
							enemy326_on <= 0;
					end
				end
				//enemy327
				else if (((hcounter >= Alienpos[21:11]+228) && (hcounter <= Alienpos[21:11]+228+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy327_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy327_row[Alienpos[21:11]+228+25-hcounter]) && (Alienstat[50]))
							enemy327_on <= 1;
						else
							enemy327_on <= 0;
					end
					else begin
						enemy327_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy327_row[Alienpos[21:11]+228+25-hcounter]) && (Alienstat[50]))
							enemy327_on <= 1;
						else
							enemy327_on <= 0;
					end
				end
				//enemy328
				else if (((hcounter >= Alienpos[21:11]+266) && (hcounter <= Alienpos[21:11]+266+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy328_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy328_row[Alienpos[21:11]+266+25-hcounter]) && (Alienstat[51]))
							enemy328_on <= 1;
						else
							enemy328_on <= 0;
					end
					else begin
						enemy328_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy328_row[Alienpos[21:11]+266+25-hcounter]) && (Alienstat[51]))
							enemy328_on <= 1;
						else
							enemy328_on <= 0;
					end
				end
				//enemy329
				else if (((hcounter >= Alienpos[21:11]+304) && (hcounter <= Alienpos[21:11]+304+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy329_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy329_row[Alienpos[21:11]+304+25-hcounter]) && (Alienstat[52]))
							enemy329_on <= 1;
						else
							enemy329_on <= 0;
					end
					else begin
						enemy329_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy329_row[Alienpos[21:11]+304+25-hcounter]) && (Alienstat[52]))
							enemy329_on <= 1;
						else
							enemy329_on <= 0;
					end
				end
				//enemy32a
				else if (((hcounter >= Alienpos[21:11]+342) && (hcounter <= Alienpos[21:11]+342+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy32a_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy32a_row[Alienpos[21:11]+342+25-hcounter]) && (Alienstat[53]))
							enemy32a_on <= 1;
						else
							enemy32a_on <= 0;
					end
					else begin
						enemy32a_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy32a_row[Alienpos[21:11]+342+25-hcounter]) && (Alienstat[53]))
							enemy32a_on <= 1;
						else
							enemy32a_on <= 0;
					end
				end
				//enemy32b
				else if (((hcounter >= Alienpos[21:11]+380) && (hcounter <= Alienpos[21:11]+380+25)) && ((vcounter >= (Alienpos[10:0]+140)) && (vcounter <= (Alienpos[10:0]+140)+17)))begin
					if (div[24]) begin
						enemy32b_row <= sprite_enemy3[vcounter - (Alienpos[10:0]+140)];
						if ((enemy32b_row[Alienpos[21:11]+380+25-hcounter]) && (Alienstat[54]))
							enemy32b_on <= 1;
						else
							enemy32b_on <= 0;
					end
					else begin
						enemy32b_row <= sprite_enemy3_v2[vcounter - (Alienpos[10:0]+140)];
						if ((enemy32b_row[Alienpos[21:11]+380+25-hcounter]) && (Alienstat[54]))
							enemy32b_on <= 1;
						else
							enemy32b_on <= 0;
					end
				end
				*/
				
				/*
				//block1_sprite_test
				else if (((hcounter >= 110) && (hcounter <= 110+45)) && ((vcounter >= 344) && (vcounter <= 344+33)))begin
					if (div[24:23] == 2'b00) begin
						block1_row <= sprite_block_v1[vcounter - 344];
						if (block1_row[110+45-hcounter])
							block1_on <= 1;
						else
							block1_on <= 0;
					end
					else if (div[24:23] == 2'b01) begin
						block1_row <= sprite_block_v2[vcounter - 344];
						if (block1_row[110+45-hcounter])
							block1_on <= 1;
						else
							block1_on <= 0;
					end
					else if (div[24:23] == 2'b10) begin
						block1_row <= sprite_block_v3[vcounter - 344];
						if (block1_row[110+45-hcounter])
							block1_on <= 1;
						else
							block1_on <= 0;
					end
					else if (div[24:23] == 2'b11) begin
						block1_row <= sprite_block_v4[vcounter - 344];
						if (block1_row[110+45-hcounter])
							block1_on <= 1;
						else
							block1_on <= 0;
					end
				end
				*/
				
				//block1
				else if (((hcounter >= 110) && (hcounter <= 110+45)) && ((vcounter >= 344) && (vcounter <= 344+33)))begin
					if (Shields[7:6] == 2'b00)
						block1_row <= sprite_block_v1[vcounter - 344];
					else if (Shields[7:6] == 2'b01)
						block1_row <= sprite_block_v2[vcounter - 344];
					else if (Shields[7:6] == 2'b10)
						block1_row <= sprite_block_v5[vcounter - 344];
					else if (Shields[7:6] == 2'b11)
						block1_row <= sprite_block_v1[vcounter - 344];
					if ((block1_row[110+45-hcounter]) && (Shields[7:6] != 2'b11))
						block1_on <= 1;
					else
						block1_on <= 0;
				end
				//block2
				else if (((hcounter >= 230) && (hcounter <= 230+45)) && ((vcounter >= 344) && (vcounter <= 344+33)))begin
					if (Shields[5:4] == 2'b00)
						block2_row <= sprite_block_v1[vcounter - 344];
					else if (Shields[5:4] == 2'b01)
						block2_row <= sprite_block_v2[vcounter - 344];
					else if (Shields[5:4] == 2'b10)
						block2_row <= sprite_block_v5[vcounter - 344];
					else if (Shields[5:4] == 2'b11)
						block2_row <= sprite_block_v1[vcounter - 344];
					if ((block2_row[230+45-hcounter]) && (Shields[5:4] != 2'b11))
						block2_on <= 1;
					else
						block2_on <= 0;
				end
				//block3
				else if (((hcounter >= 350) && (hcounter <= 350+45)) && ((vcounter >= 344) && (vcounter <= 344+33)))begin
					if (Shields[3:2] == 2'b00)
						block3_row <= sprite_block_v1[vcounter - 344];
					else if (Shields[3:2] == 2'b01)
						block3_row <= sprite_block_v2[vcounter - 344];
					else if (Shields[3:2] == 2'b10)
						block3_row <= sprite_block_v5[vcounter - 344];
					else if (Shields[3:2] == 2'b11)
						block3_row <= sprite_block_v1[vcounter - 344];
					if ((block3_row[350+45-hcounter]) && (Shields[3:2] != 2'b11))
						block3_on <= 1;
					else
						block3_on <= 0;
				end
				//block4
				else if (((hcounter >= 470) && (hcounter <= 470+45)) && ((vcounter >= 344) && (vcounter <= 344+33)))begin
					if (Shields[1:0] == 2'b00)
						block4_row <= sprite_block_v1[vcounter - 344];
					else if (Shields[1:0] == 2'b01)
						block4_row <= sprite_block_v2[vcounter - 344];
					else if (Shields[1:0] == 2'b10)
						block4_row <= sprite_block_v5[vcounter - 344];
					else if (Shields[1:0] == 2'b11)
						block4_row <= sprite_block_v1[vcounter - 344];
					if ((block4_row[470+45-hcounter]) && (Shields[1:0] != 2'b11))
						block4_on <= 1;
					else
						block4_on <= 0;
				end
				
				//life1
				else if (((hcounter >= 110) && (hcounter <= 110+27)) && ((vcounter >= line3_v) && (vcounter <= line3_v+17)))begin
					life1_row <= sprite_player[vcounter - line3_v];
					if ((life1_row[110+27-hcounter]) && ((Player1[12:11] == 2'b11) || (Player1[12:11] == 2'b10)))
						life1_on <= 1;
					else
						life1_on <= 0;
				end
				//life2
				else if (((hcounter >= 150) && (hcounter <= 150+27)) && ((vcounter >= line3_v) && (vcounter <= line3_v+17)))begin
					life2_row <= sprite_player[vcounter - line3_v];
					if ((life2_row[150+27-hcounter]) && (Player1[12:11] == 2'b11))
						life2_on <= 1;
					else
						life2_on <= 0;
				end
				
				//life_digit
				else if (((hcounter >= 70) && (hcounter <= 70+15)) && ((vcounter >= line3_v) && (vcounter <= line3_v+15)))begin
					case (Player1[12:11])
						2'b00 : life_digit_row <= sprite_0[vcounter - line3_v];
						2'b01 : life_digit_row <= sprite_1[vcounter - line3_v];
						2'b10 : life_digit_row <= sprite_2[vcounter - line3_v];
						2'b11 : life_digit_row <= sprite_3[vcounter - line3_v];
						default : life_digit_row <= sprite_3[vcounter - line3_v];
					endcase
					if (life_digit_row[70+15-hcounter])
						life_digit_on <= 1;
					else
						life_digit_on <= 0;
				end
				//bonus
				else if (((hcounter >= Bonus[10:0]) && (hcounter <= Bonus[10:0]+33)) && ((vcounter >= 63) && (vcounter <= 63+15)))begin
					bonus_row <= sprite_bonus[vcounter - 63];
					if ((bonus_row[Bonus[10:0]+33-hcounter]) && (Bonus[11]))
						bonus_on <= 1;
					else
						bonus_on <= 0;
				end
				
				//player
				else if (((hcounter >= Player1[10:0]) && (hcounter <= Player1[10:0]+27)) && ((vcounter >= 392) && (vcounter <= 392+17)))begin
					player_row <= sprite_player[vcounter - 392];
					if ((player_row[Player1[10:0]+27-hcounter]) && (Player1[12:11] != 2'b00))
						player_on <= 1;
					else
						player_on <= 0;
				end
				
				/*
				//player w/ explosion
				else if (((hcounter >= player_h) && (hcounter <= player_h+27)) && ((vcounter >= 392) && (vcounter <= 392+17)))begin
					if (div[24]) begin
						player_row <= sprite_player[vcounter - 392];
						if (player_row[player_h+27-hcounter])
							player_on <= 1;
						else
							player_on <= 0;
					end
					else begin
						player_row <= sprite_explosion_player[vcounter - 392];
						if (player_row[player_h+27-hcounter])
							player_on <= 1;
						else
							player_on <= 0;
					end		
				end
				*/
				//player1 bullet
				else if (((hcounter >= Player1_Bullet[21:11]) && (hcounter <= Player1_Bullet[21:11]+3)) && ((vcounter >= Player1_Bullet[10:0]) && (vcounter <= Player1_Bullet[10:0]+9)))begin
					bullet0_row <= sprite_bullet_player[vcounter - Player1_Bullet[10:0]];
					if ((bullet0_row[Player1_Bullet[21:11]+3-hcounter]) && (Player1_Bullet[22]))
						bullet0_on <= 1;
					else
						bullet0_on <= 0;
				end
				

				//enemy bullet type 1 (v1 v2)
				else if (((hcounter >= Alien_Bullet1[21:11]) && (hcounter <= Alien_Bullet1[21:11]+7)) && ((vcounter >= Alien_Bullet1[10:0]) && (vcounter <= Alien_Bullet1[10:0]+12)))begin
					if (div[22]) begin
						bullet1_row <= sprite_bullet_enemy_v1[vcounter - Alien_Bullet1[10:0]];
						if ((bullet1_row[Alien_Bullet1[21:11]+7-hcounter]) && (Alien_Bullet1[22]))
							bullet1_on <= 1;
						else
							bullet1_on <= 0;
					end
					else begin
						bullet1_row <= sprite_bullet_enemy_v2[vcounter - Alien_Bullet1[10:0]];
						if ((bullet1_row[Alien_Bullet1[21:11]+7-hcounter]) && (Alien_Bullet1[22]))
							bullet1_on <= 1;
						else
							bullet1_on <= 0;
					end
				end
				
				/*
				//enemy bullet type 2 (v3 v4)
				else if (((hcounter >= Alien_Bullet2[21:11]) && (hcounter <= Alien_Bullet2[21:11]+7)) && ((vcounter >= Alien_Bullet2[10:0]) && (vcounter <= Alien_Bullet2[10:0]+12)))begin
					if (div[22]) begin
						bullet2_row <= sprite_bullet_enemy_v3[vcounter - Alien_Bullet2[10:0]];
						if ((bullet2_row[Alien_Bullet2[21:11]+7-hcounter]) && (Alien_Bullet2[22]))
							bullet2_on <= 1;
						else
							bullet2_on <= 0;
					end
					else begin
						bullet2_row <= sprite_bullet_enemy_v4[vcounter - Alien_Bullet2[10:0]];
						if ((bullet2_row[Alien_Bullet2[21:11]+7-hcounter])&& (Alien_Bullet2[22]))
							bullet2_on <= 1;
						else
							bullet2_on <= 0;
					end
				end
				//enemy bullet type 3 (v5 v6)
				else if (((hcounter >= && (Alien_Bullet3[21:11]))) && (hcounter <= Alien_Bullet3[21:11]+7)) && ((vcounter >= Alien_Bullet3[10:0]) && (vcounter <= Alien_Bullet3[10:0]+12)))begin
					if (div[22]) begin
						bullet3_row <= sprite_bullet_enemy_v5[vcounter - Alien_Bullet3[10:0]];
						if ((bullet3_row[Alien_Bullet3[21:11]+7-hcounter]) && (Alien_Bullet3[22]))
							bullet3_on <= 1;
						else
							bullet3_on <= 0;
					end
					else begin
						bullet3_row <= sprite_bullet_enemy_v6[vcounter - Alien_Bullet3[10:0]];
						if ((bullet3_row[Alien_Bullet3[21:11]+7-hcounter]) && (Alien_Bullet3[22]))
							bullet3_on <= 1;
						else
							bullet3_on <= 0;
					end
				end
				*/
				
				//green separating line
				else if (((hcounter >= 64) && (hcounter <= 575)) && ((vcounter >= 446) && (vcounter <= 448))) begin
					line_on <= 1;
				end
				else begin
					line_on <= 0;
				end
		end
	end
	
	always @ (posedge (pclk)) begin
		if (letter1_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter2_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter3_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter4_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter5_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter6_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter7_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter8_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter9_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter10_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter11_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter12_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter13_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter14_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter15_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter16_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter17_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter18_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter19_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter20_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter21_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter22_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter23_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter24_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit0_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit1_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit2_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit3_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit4_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit5_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit6_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit7_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter25_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter26_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter27_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter28_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter29_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (letter30_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit8_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (digit9_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy11_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy12_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy13_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy14_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy15_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy16_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy17_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy18_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy19_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy1a_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy1b_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy211_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy212_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy213_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy214_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy215_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy216_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy217_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy218_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy219_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy21a_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy21b_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy221_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy222_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy223_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy224_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy225_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy226_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy227_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy228_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy229_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy22a_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy22b_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy311_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy312_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy313_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy314_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy315_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy316_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy317_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy318_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy319_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy31a_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy31b_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy321_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy322_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy323_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy324_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy325_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy326_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy327_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy328_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy329_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy32a_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (enemy32b_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (player_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (life1_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (life2_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (life_digit_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (block1_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (block2_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (block3_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (block4_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else if (bonus_on) begin
			red <= 3'b111;
			green <= 3'b000;
			blue <= 2'b00;
		end
		else if (bullet0_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (bullet1_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (bullet2_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (bullet3_on) begin
			red <= 3'b111;
			green <= 3'b111;
			blue <= 2'b11;
		end
		else if (line_on) begin
			red <= 3'b000;
			green <= 3'b111;
			blue <= 2'b00;
		end
		else begin
			red <= 3'b000;
			green <= 3'b000;
			blue <= 2'b00;
		end
	end

endmodule
